Beruflich Dokumente
Kultur Dokumente
* File: 20160927_CPP_L12.cpp.
* Title: 2016-09-27 C++ Lesson 12
* Author: Renato Montes
* Description: Notes for Albert Wei's C++ class
*/
//in main:
cout << uppercase(s) << endl;
//append is similar to +=
s1 =+ s2;
s1.append(s2);
/* Search functions */
//find first of looks for the first occurrence of a character in the passed
// string: find_first_of("abc") looks for first occurrence of a, b or c
//need to create
string::size_type idx;
//to store the index
//then if statement with equals to string::npos as in the sheet
//The program "replace"
//commmandline:
./replace hello world! < ___ > ___
//Example
"ab:c;d.ef:gh;.ij" //delimiters: ":;."
//tokenize (i.e. break up) the string at the delimiters
"ab" "c" "d" "ef" "gh" "ij" //no empty tokens