suppoSEOneLineTextisastring
Don'tforgettochecktheindexoritcouldbeoutofrange!LenthgcheckingmustperformeatfirstratherthanAccessthecharinthestringorthestringwillbealsooutofrange!
ThefollowingwillbeoutofrangebecauseitMayaccesthecharacteroutoftherangbeforeitchecktheboundary.
=============================================
while(isalpha(OneLineText.at(i))&&(i<LengthOfText))
{
i ;
}//endwhile
=============================================
Thefollowingcodewillbeallright.
=============================================
while((i<LengthOfText)&&isalpha(OneLineText.at(i)))
{
i ;
}//endwhile
=============================================