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.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; 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){ byte[] rawBytes = System.Text.Encoding.ASCII.GetBytes(s); return "0x" + BitConverter.ToString(rawBytes).Replace("-", ""); } } }
run
|
edit
|
history
|
help
0
Jhjj
math 10.97
Lambdas
Selection Sort
d
Test
dxlfkgjdlkgj
Tarkov Time
Dependency Injection - with class
azs dasx