c# - Escape zero character in number format -
is there way escape 0 -character character in c#, when using integer's .tostring() -method?
example code:
(112233).tostring("zerohereaschar:_0_numberhere:0")
as result string:
zerohereaschar:_0_numberhere:112233
,
but i'm getting:
zerohereaschar:11223_numberhere:3
you can use backslash escape character:
(112233).tostring("zerohereaschar:_\\0_numberhere:0");
or verbatim string literal:
(112233).tostring(@"zerohereaschar:_\0_numberhere:0");
Comments
Post a Comment