I have a string that can contain a value like 000232 or 999999 or 023000
What I am trying to do is to remove the first 000 from the first string, leave the second string and remove the first 0 from the third string and keep 000 to the right
How do I best perfrom this?
Thanks in advance
Use
String.TrimStart:Please note that it is essential that you assign the result of
String.TrimStartto a variable of typestring. In .NET,strings are immutable and thereforeString.TrimStartdoes not modify thestringthat the method is invoked on. That is,s.TrimStart('0')does not modifys. If you want to modifysyou must say