本文整理汇总了C++中vsString::length方法的典型用法代码示例。如果您正苦于以下问题:C++ vsString::length方法的具体用法?C++ vsString::length怎么用?C++ vsString::length使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vsString
的用法示例。
在下文中一共展示了vsString::length方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtractWhitespaceStringToken
static vsString ExtractWhitespaceStringToken( vsString &string ) // pull out a string defined by whitespace
{
vsString label;
size_t len = string.length();
size_t index = 0;
for ( index = 0; index < len; index++ )
{
if ( IsWhitespace(string[index]) ) // this character isn't alphabetic, so isn't part of the label
{
index--; // back up one character
break; // exit the loop
}
}
label = string.substr(0, index+1);
string.erase(0,index+1);
return label;
}
示例2: ExtractNumberToken
static vsString ExtractNumberToken( vsString &string )
{
vsAssert(IsNumeric(string[0]), "Tried to extract a number from something that isn't a number!");
// okay. We need to find
vsString numberString;
size_t len = string.length();
size_t index = 0;
for ( index = 0; index < len; index++ )
{
if ( !IsNumeric(string[index]) ) // this character isn't alphabetic, so isn't part of the label
{
index--; // back up one character
break; // exit the loop
}
}
numberString = string.substr(0, index+1);
string.erase(0,index+1);
return numberString;
}