contents   index   previous   next



Clib.strrchr()

syntax:

Clib.strrchr(str, chr)

where:

str - string to search.

 

chr - character to search for.

 

return:

string - beginning with the first character found from the right, else null.

 

description:

This method searches a string for the last occurrence of chr. The search is in the reverse direction, from the right, for chr in a string. The method returns a variable indicating the last occurrence of chr in a string, else it returns null if chr is not found in str.

 

see:

Clib.strchr()

 

example:

// The following code:

 

var str = "I can't stand soggy cereal." 

var substr = Clib.strrchr(str, 's'); 

Clib.printf("str = %s\n", str); 

Screen.writeln("substr = " + substr);

 

// Results in the following output.

//  str = I can't stand soggy cereal.

//  substr = soggy cereal.

 


Clib.strspn()