In absence of OP's clarification, this question could be interpreted in the sense of converting any string to a number, i.e. turning "dog" into a number (which of course can be done).
I want to convert a C# DateTime to "YYYYMMDDHHMMSS" format. But I can't find a built-in method to get this format. How can I do it?
How do you convert Unix epoch time into real time in C#? (Epoch beginning 1/1/1970)
If you want to use Convert.ToByte(String, Int32) (because you don't want to re-implement that functionality yourself), there doesn't seem to be a way to beat String.Substring; all you do is run in circles, re-inventing the wheel (only with sub-optimal materials).
How do you convert a byte array to a hexadecimal string, and vice versa?
Here is an implementation of a function to convert a string to a list that isn't very short, but it is very simple and straightforward and does exactly what you would expect it to and what you would do if you were doing this manually:
6 You can use new C# 6.0 Language Features: replace delegate (s) => { return Convert.ToInt32(s); } with corresponding method group Convert.ToInt32 replace redundant constructor call: new ConverterIf you want to convert a digit (0-9), you can add 48 to it and cast, or something like Character.forDigit(a, 10);. If you want to convert an int seen as a Unicode code point, you can use Character.toChars(48) for example.
How do I convert the integer value "45" into the string value "45" in Excel VBA?
How Do I Convert an Integer to a String in Excel VBA?