int find_first_of(char c, int start = 0): 查找字符串中第1个出现的c,由位置start开始. 如果有匹配,则返回匹配位置:否则,返回-1.默认情况下,start为0,函数搜索 整个字符串. int find_last_of(char c): 查找字符串中最后一个出现的c.有匹配,则返回匹配位置:否则返回-1.
今天在代码中用到string的这个方法,一不小心就用错了. 这是http://www.cplusplus.com/关于这个方法的解释. Find character in string from the end Searches the string for the last character that matches any of the characters specified in its arguments. When pos is specified, the search only
Write a function that takes a string as input and reverse only the vowels of a string. Example 1:Given s = "hello", return "holle". Example 2:Given s = "leetcode", return "leotcede". 个人博客:http://www.cnblogs.com/wdfw