Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

how to find something in a string in c++

const char* c = "Word";
string str = "WhereIsMyWordThatINeed";
cout << "the word is at index " << str.find(c);
//this will print "the word is at index 9"
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #find #string
ADD COMMENT
Topic
Name
3+1 =