I have a string like \"sample\". I want to get a string of it in hex format; like this:
\"796173767265\"
Please give the
var result = string.Join("", input.Select(c => ((int)c).ToString("X2")));
OR
var result =string.Join("", input.Select(c=> String.Format("{0:X2}", Convert.ToInt32(c))));