'z' " returns false " Equality Tests if two strings are equal. See also #Compare and #Compare. Note that doing equality checks via a generic Compare with integer result is not only confusing for the programmer but is often a significantly more expensive operation; this is especially true when using "C-strings". // Example in C# "hello" == "world" // returns false ' Example in Visual Basic "hello" = "world" ' returns false # Examples in Perl 5 'hello' eq 'world' # returns 0 'hello' eq 'hello' # returns 1 # Examples in Raku 'hello' eq 'world' # returns False 'hello' eq 'hello' # returns True # Example in Windows PowerShell "hello" -eq "world" # returns false ⍝ Example in APL 'hello' ≡ 'world' ⍝ returns 0 Find ; Examples in Common Lisp (search "e" "Hello mate") ; returns 1 (search "z" "word") ; returns NIL // Examples in C# "Hello mate".IndexOf("e"); // returns 1 "Hello mate".IndexOf("e", 4); // returns 9 "word".IndexOf("z"); // returns -1 # Examples in Raku "Hello, there!".index('e') # returns 1 "Hello, there!".index('z') # returns Nil ; Examples in Scheme (use-modules (srfi srfi-13)) (string-contains "Hello mate" "e") ; returns 1 (string-contains "word" "z") ; returns #f ' Examples in Visual Basic InStr("Hello mate", "e") ' returns 2 InStr(5, "Hello mate", "e") ' returns 10 InStr("word", "z") ' returns 0 " Examples in Smalltalk " 'Hello mate' indexOfSubCollection:'ate' "returns 8" 'Hello mate' indexOfSubCollection:'late' "returns 0" I'Hello mate' indexOfSubCollection:'late' ifAbsent:[ 99 ] "returns 99" 'Hello mate' indexOfSubCollection:'late' ifAbsent:[ self error ] "raises an exception" Find character // Examples in C# "Hello mate".IndexOf('e'); // returns 1 "word".IndexOf('z') // returns -1 ; Examples in Common Lisp (position #\e "Hello mate") ; returns 1 (position #\z "word") ; returns NIL Given a set of characters, SCAN returns the position of the first character found, while VERIFY returns the position of the first character that does not belong to the set. Format // Example in C# String.Format("My {0} costs {1:C2}", "pen", 19.99); // returns "My pen costs $19.99" // Example in Object Pascal (Delphi) Format('My %s costs $%2f', ['pen', 19.99]); // returns "My pen costs $19.99" // Example in Java String.format("My %s costs $%2f", "pen", 19.99); // returns "My pen costs $19.99" # Examples in Raku sprintf "My %s costs \$%.2f", "pen", 19.99; # returns "My pen costs $19.99" 1.fmt("%04d"); # returns "0001" # Example in Python "My %s costs $%.2f" % ("pen", 19.99);