Hello! How do I get the substring of a specific string. Let’s say, for example, that the full string is 123456789.
- I’ve been able to use variable.toString().substring(0,3) to pull 123 from the string.
- I can’t seem to figure out how to get 45 from 123456789. I tried variable.toString().substring(3,2) and variable.toString().substring(4,2), but neither of them are pulling what I need. When I use (3,2), it pulls only the 3rd character from the string, the 3. When I use (4,2), it pulls the 3rd and 4th characters, the 3 and 4. When I use (5,2), I get the 3rd, 4th, and 5th characters, the 3, the 4, and the 5.
- I’ve been able to use variable.toString().substring(5) to pull 6789 from the string.
What am I doing wrong for the middle piece? Thank you in advance!
I posted this question here in the event so that someone else needs the same answer, they can easily get it from the forum. Thanks!