Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
transform string to hex code
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Linq; namespace Rextester { public class Program { public static void Main(string[] args) { //transform string to hex code. ignore '0x' string test = "stringtohex"; Console.WriteLine(GetHex(test)); } public static string GetHex(string s) { return "0x" + string.Join("", s.Select(c => Convert.ToByte(c).ToString("X2"))); } } }
run
|
edit
|
history
|
help
0
List Array
test
4 Distinct Integer Custom Code Generator
Mostafa Shehata Ahmed
Aufgabe 1 J.S.
LoL
Fibonacci
Y Fibonnoci
4
1.3 Basics: interfaces