示例#1
0
/**
 * Expression function for getting a character from a string
 */
gd::String GD_API StrAt(const gd::String & str, size_t pos )
{
    if ( pos < str.size() )
        return str.substr(pos, 1);

    return "";
}
示例#2
0
/**
 * Expression function for getting a substring from a string
 */
gd::String GD_API SubStr(const gd::String & str, size_t start, size_t length )
{
    if ( start < str.size() )
        return str.substr(start, length);

    return "";
}
示例#3
0
/**
 * Expression function for getting a substring from a string
 */
std::size_t GD_API StrLen(const gd::String & str)
{
    return str.size();
}