operator==,!=,<,<=,>,>=(std::basic_string)
来自cppreference.com
< cpp | string | basic string
|
|
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
| template< class T, class Alloc > bool operator==( basic_string<T,Alloc>& lhs, basic_string<T,Alloc>& rhs ); |
(1) | |
| template< class T, class Alloc > bool operator!=( basic_string<T,Alloc>& lhs, basic_string<T,Alloc>& rhs ); |
(2) | |
| template< class T, class Alloc > bool operator<( basic_string<T,Alloc>& lhs, basic_string<T,Alloc>& rhs ); |
(3) | |
| template< class T, class Alloc > bool operator<=( basic_string<T,Alloc>& lhs, basic_string<T,Alloc>& rhs ); |
(4) | |
| template< class T, class Alloc > bool operator>( basic_string<T,Alloc>& lhs, basic_string<T,Alloc>& rhs ); |
(5) | |
| template< class T, class Alloc > bool operator>=( basic_string<T,Alloc>& lhs, basic_string<T,Alloc>& rhs ); |
(6) | |
比较两个字符串的内容.....
1-2) 原文:
Compares the contents of two strings.
检查的内容是否
3-6) lhs和rhs是相等的,即,lhs.size() == rhs.size()和中的每个字符lhs在相同的位置,具有同等的字符rhs.原文:
Checks if the contents of
lhs and rhs are equal, that is, lhs.size() == rhs.size() and each character in lhs has equivalent character in rhs at the same position.比较的内容
lhsrhs字典。在执行比较的功能相当于std::lexicographical_compare.原文:
Compares the contents of
lhs and rhs lexicographically. The comparison is performed by a function equivalent to std::lexicographical_compare.[编辑] 参数
| lhs, rhs | - | 字符串的内容进行比较
|
[编辑] 返回值
1)true的字符串的内容是否是等效,false否则
2) 原文:
true if the contents of the strings are equivalent, false otherwise
true的字符串的内容,如果是不等价的,false否则
3) 原文:
true if the contents of the strings are not equivalent, false otherwise
true如果内容的
4) lhs字典“小于”比内容rhs,false否则原文:
true if the contents of the
lhs are lexicographically less than the contents of rhs, false otherwisetrue如果内容的
5) lhs字典“小于”或“等于”的内容rhs,false否则原文:
true if the contents of the
lhs are lexicographically less than or equal the contents of rhs, false otherwisetrue如果内容的
6) lhs字典“更大”比内容rhs,false否则原文:
true if the contents of the
lhs are lexicographically greater than the contents of rhs, false otherwisetrue如果内容的
lhs字典“更大”大于或“等于”的内容rhs,false否则原文:
true if the contents of the
lhs are lexicographically greater than or equal the contents of rhs, false otherwise[编辑] 复杂度
线性的字符串的大小.