Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
Create URL Safe and Cryptographically Strong Short GUID
Lambda Expression
Math 9.4
Swiss Infotech Tutorial
Numerical string to fancy graphical output
Anq Calc
XML filtering example
timer
to find all substring
Random number IF var change
Please log in to post a comment.