Logo Search packages:      
Sourcecode: inkscape version File versions

String buildtool::MakeBase::strip ( const String &  s  )  [protected, inherited]

replace runs of whitespace with a space

replace runs of whitespace with a single space

Definition at line 3289 of file buildtool.cpp.

{
    int len = s.size();
    String stripped;
    for (int i = 0 ; i<len ; i++)
        {
        char ch = s[i];
        if (isspace(ch))
            {
            stripped.push_back(' ');
            for ( ; i<len ; i++)
                {
                ch = s[i];
                if (!isspace(ch))
                    {
                    stripped.push_back(ch);
                    break;
                    }
                }
            }
        else
            {
            stripped.push_back(ch);
            }
        }
    return stripped;
}


Generated by  Doxygen 1.6.0   Back to index