Substr()?

Hi

Can anyone look at the code below and explain why it works sometimes and not others?
strSl_Title is taken from an array and the whole process is in a loop.


if (strSl_Title.length>31) {
        myString = strSl_Title.substr(0 , 28) ;
        strSl_Title = ""+myString+"...";
    }

It appears to be something to do with spaces in the string but I ain’t sure?
Publishing for FP8

Cheers TC