About ".substr"

I was reading in the HELP, about “.substr”.
I tried to make an example, like this.


var my_str:String = "Hello world";
//dynamic text field, instance
exemplo_txt.html = true;
exemplo_txt.htmlText = "<font size =\"10\">" + my_str.substr(0, 2) + "</font>" + "<font size=\"28\">" + my_str.substr(2, my_str.length) + "</font>";
trace(exemplo_txt);

it goes to catch the two first letters, and to place a font size 10.
later it it goes to catch the text and to place a font size 28.
my question:
exists some way to block, the text, it to only start to change the font size after caracter 5?
because I do not know, how many characters I´m going to have, if I´m going to be only 1 caracter or only 3 or only 4.