0 -- Examples in Lua ("hello"):len() -- returns 5 #"" -- returns 0 locate see #Find Lowercase // Example in C# "Wiki means fast?".ToLower(); // "wiki means fast?" ; Example in Scheme (use-modules (srfi srfi-13)) (string-downcase "Wiki means fast?") ; "wiki means fast?" /* Example in C */ #include <ctype.h> #include <stdio.h> int main(void) { char string[] = "Wiki means fast?"; int i; for (i = 0; i < sizeof(string) - 1; ++i) { /* transform characters in place, one by one */ string[i] = tolower(string[i]); } puts(string); /* "wiki means fast?" */ return 0; } # Example in Raku "Wiki means fast?".lc; # "wiki means fast?" mid see #substring partition # Examples in Python "Spam eggs spam spam and ham".partition('spam') # ('Spam eggs ', 'spam', ' spam and ham') "Spam eggs spam spam and ham".partition('X') # ('Spam eggs spam spam and ham', "", "") # Examples in Perl 5 / Raku split /(spam)/, 'Spam eggs spam spam and ham' ,2; # ('Spam eggs ', 'spam', ' spam and ham'); split /(X)/, 'Spam eggs spam spam and ham' ,2; # ('Spam eggs spam spam and ham'); replace // Examples in C# "effffff".Replace("f", "jump"); // returns "ejumpjumpjumpjumpjumpjump" "blah".Replace("z", "y"); // returns "blah" // Examples in Java "effffff".replace("f", "jump"); // returns "ejumpjumpjumpjumpjumpjump" "effffff".replaceAll("f*", "jump"); // returns "ejump" // Examples in Raku "effffff".subst("f", "jump", :g); # returns "ejumpjumpjumpjumpjumpjump" "blah".subst("z", "y", :g); # returns "blah" ' Examples in Visual Basic Replace("effffff", "f", "jump") ' returns "ejumpjumpjumpjumpjumpjump" Replace("blah", "z", "y") ' returns "blah" # Examples in Windows PowerShell "effffff" -replace "f", "jump" # returns "ejumpjumpjumpjumpjumpjump" "effffff" -replace "f*", "jump" # returns "ejump" reverse " Example in Smalltalk " 'hello' reversed " returns 'olleh' " # Example in Perl 5 reverse "hello" # returns "olleh" # Example in Raku "hello".flip # returns "olleh" # Example in Python "hello"[::-1] # returns "olleh" ; Example in Scheme (use-modules (srfi srfi-13)) (string-reverse "hello") ; returns "olleh" rfind ; Examples in Common Lisp (search "e" "Hello mate" :from-end t) ; returns 9 (search "z" "word" :from-end t) ; returns NIL // Examples in C# "Hello mate".LastIndexOf("e"); // returns 9 "Hello mate".LastIndexOf("e", 4); // returns 1 "word".LastIndexOf("z"); // returns -1 # Examples in Perl 5 rindex("Hello mate", "e"); # returns 9 rindex("Hello mate", "e", 4); # returns 1 rindex("word", "z"); # returns -1 # Examples in Raku "Hello mate".rindex("e"); # returns 9 "Hello mate".rindex("e", 4); # returns 1 "word".rindex('z'); # returns