I have a variable string text containing lets say “ABCDEFGHIJKL”.
I want to trim it so string new text = “CDE” in other words keep letters 2 to 4. if A is zero.
How can i do this?
I have a variable string text containing lets say ABCDEFGHIJKL. I want to trim
Share
I think you’re just looking for string.Substring:
Here 3 is the length – characters 2-4 inclusive means 3 characters.
If you’re not looking to take a known “slice” of the string (by index and length) please clarify your question.