Nil ' Examples in Visual Basic InStrRev("Hello mate", "e") ' returns 10 InStrRev(5, "Hello mate", "e") ' returns 2 InStrRev("word", "z") ' returns 0 right // Examples in Java; extract rightmost 4 characters String str = "CarDoor"; str.substring(str.length()-4); // returns 'Door' # Examples in Raku "abcde".substr(*-3); # returns "cde" "abcde".substr(*-8); # 'out of range' error /* Examples in Rexx */ right("abcde", 3) /* returns "cde" */ right("abcde", 8) /* returns " abcde" */ right("abcde", 8, "*") /* returns "***abcde" */ ; Examples in Scheme (use-modules (srfi srfi-13)) (string-take-right "abcde", 3) ; returns "cde" (string-take-right "abcde", 8) ; error ' Examples in Visual Basic Right("sandroguidi", 3) ' returns "idi" Right("sandroguidi", 100) ' returns "sandroguidi" rpartition # Examples in Python "Spam eggs spam spam and ham".rpartition('spam') ### ('Spam eggs spam ', 'spam', ' and ham') "Spam eggs spam spam and ham".rpartition('X') ### ("", "", 'Spam eggs spam spam and ham') slice see #substring split // Example in C# "abc,defgh,ijk".Split(','); // {"abc", "defgh", "ijk"} "abc,defgh;ijk".Split(',', ';'); // {"abc", "defgh", "ijk"} % Example in Erlang string:tokens("abc;defgh;ijk", ";"). % ["abc", "defgh", "ijk"] // Examples in Java "abc,defgh,ijk".split(","); // {"abc", "defgh", "ijk"} "abc,defgh;ijk".split(",|;"); // {"abc", "defgh", "ijk"} { Example in Pascal } var lStrings: TStringList; lStr: string; begin lStrings := TStringList.Create; lStrings.Delimiter := ','; lStrings.DelimitedText := 'abc,defgh,ijk'; lStr := lStrings.Strings[0]; // 'abc' lStr := lStrings.Strings[1]; // 'defgh' lStr := lStrings.Strings[2]; // 'ijk' end; # Examples in Perl 5 split(/spam/, 'Spam eggs spam spam and ham'); # ('Spam eggs ', ' ', ' and ham') split(/X/, 'Spam eggs spam spam and ham'); # ('Spam eggs spam spam and ham') # Examples in Raku 'Spam eggs spam spam and ham'.split(/spam/); # (Spam eggs and ham) split(/X/, 'Spam eggs spam spam and ham'); # (Spam eggs spam spam and ham) sprintf see #Format strip see #trim strcmp see #Compare (integer result) substring // Examples in C# "abc".Substring(1, 1): // returns "b" "abc".Substring(1, 2); // returns "bc" "abc".Substring(1, 6); // error ;; Examples in Common Lisp (subseq "abc" 1 2) ; returns "b" (subseq "abc" 2) ; returns "c" % Examples in Erlang string:substr("abc", 2, 1). % returns "b" string:substr("abc", 2). % returns "bc" # Examples in Perl 5 substr("abc", 1, 1); # returns "b" substr("abc", 1); # returns "bc" # Examples in Raku "abc".substr(1, 1); # returns "b" "abc".substr(1); # returns "bc" # Examples in Python "abc"[1:2] # returns "b" "abc"[1:3] # returns "bc" /* Examples in Rexx */