回覆列表
  • 1 # 你永遠追不上的巨人

    查詢(find)語法: size_type find( const basic_string &str, size_type index ); size_type find( const char *str, size_type index ); size_type find( const char *str, size_type index, size_type length ); size_type find( char ch, size_type index );find()函式: 返回str在字串中第一次出現的位置(從index開始查詢)。如果沒找到則返回string::npos, 返回str在字串中第一次出現的位置(從index開始查詢,長度為length)。如果沒找到就返回string::npos, 返回字元ch在字串中第一次出現的位置(從index開始查詢)。如果沒找到就返回string::npos 例如, string str1( "Alpha Beta Gamma Delta" ); unsigned int loc = str1.find( "Omega", 0 ); if( loc != string::npos ) cout

  • 中秋節和大豐收的關聯?
  • 6歲孩子咽炎,有白痰,喉嚨裡呼嚕呼嚕的怎麼治療?