I have a string with the following value: var myString = "17124\0\0\0";
I need to do two things with the string:
- Get the string length
- Save the string to the database
Unfortunately, \0 is c# is the equivalent to null.
I have tried several things including replacing \ with \ myString.Replace(@"\", @"");
I have also tried getting the length by using the following code:
var myLength = myString.Length;
Everything that I try treats every combination of \0 as null.
Important: I cannot strip \0 out of the string, because that is the value of the string.