コード例 #1
0
ファイル: kstringhandler.cpp プロジェクト: Fat-Zer/tdelibs
//
// Insertion and removal routines
//
TQString KStringHandler::insword( const TQString &text , const TQString &word , uint pos )
{
    if ( text.isEmpty() )
        return word;

    if ( word.isEmpty() )
        return text;

    // Split words and add into list
    TQStringList list = TQStringList::split( " ", text, true );

    if ( pos >= list.count() )
        list.append( word );
    else
        list.insert( list.at(pos) , word );

    // Rejoin
    return list.join( " " );
}