现在的位置: 首页 > 综合 > 正文

strSplit分隔文本以container返回

2012年12月24日 ⁄ 综合 ⁄ 共 401字 ⁄ 字号 评论关闭

public container strSplit(str _stringToSplit, str _delimiters)
{
    container c;
    int oldPos = 1;
    int pos;
    int strLength = strlen(_stringToSplit);

    do
    {
        pos = strfind(_stringToSplit, _delimiters, oldPos, strLength);
        if (!pos)
            pos = strLength+1;
        c = conins(c,conlen(c)+1,strreplace(substr(_stringToSplit, oldPos, pos-oldPos),"\r",""));
        oldPos = pos+1;
    } while (pos <= strLength);

    return c;
}

抱歉!评论已关闭.