StringWord
string StringWord(string s, int n);
Return the n'th word of the string
Parameters
- string s
String that contains the words
- int n
Position of the word to extract. Start at 1
Return value
int -
n'th word of the string. If it does not exists then return the empty string
Examples
- Example: Usage
string phrase = "You are on sc2mapster";
// 1 2 3 4
string website = StringWord(phrase, 4); // "sc2mapster"
You must login to post a comment. Don't have an account? Register to get one!
Facts
- Date created
- Mar 08, 2010