For the length, stm.latestNumber will give you the index you need!
Another option for stopping text is to use Append() when you need to add more text to a string. Will this work for your needs?