Hello guys,
What is the method to do an IndexOf a string?
like I have a string “pin1”;
I want to get the number 1 so I wanted to do something like:
this.tag.IndexOf(3);
How?
Thanks!
Hello guys,
What is the method to do an IndexOf a string?
like I have a string “pin1”;
I want to get the number 1 so I wanted to do something like:
this.tag.IndexOf(3);
How?
Thanks!
There are a number of ways to do this with the String class. Here’s one:
string myString = "pin1";
string part = myString.Substring(3, 1);
So, get 1 character, starting at position 3 (with the first char being at position 0).
Jeff
Many thanks!