从字符串第一位开始截取找到空格结束取空格前的内容
static void Job47(Args _args)
{
str xx = "23dsdasafdf 987";
int i,iLength,k;
iLength = strLen(xx);
for (i=1;i< iLength;i++ )
{
if ( subStr(xx,i,1) == " " )
{
k = iLength-i;
break;
}
}
info( subStr(xx,1,i));
}
截图如下
从字符串第一位开始截取到最后一位不是数字停止
static void Job51(Args _args)
{
str xx = "adshasdfasdldsflksd98776";
int i;
str strXX;
boolean result;
for (i=1;i<= strLen(xx);i++)
{
strXX = subStr(xx,strLen(xx)-i,1);
result = System.Char::IsLetter(xx,strLen(xx)-i);
if (result == true)
{
info(subStr(xx,1,strLen(xx)-i+1));
break;
}
}
}
截图如下