World", 1, 1); # 'e' # Examples in Python "Hello, World"[2] # 'l' "Hello, World"[-3] # 'r' # Example in Raku "Hello, World".substr(1, 1); # 'e' ' Example in Visual Basic Mid("Hello, World",2,1) ' Example in Visual Basic .NET "Hello, World".Chars(2) ' "l"c " Example in Smalltalk " 'Hello, World' at: 2. "$e" //Example in Rust "Hello, World".chars().nth(2); // Some('l') Compare (integer result) # Example in Perl 5 "hello" cmp "world"; # returns -1 # Example in Python cmp("hello", "world") # returns -1 # Examples in Raku "hello" cmp "world"; # returns Less "world" cmp "hello"; # returns More "hello" cmp "hello"; # returns Same /** Example in Rexx */ compare("hello", "world") /* returns index of mismatch: 1 */ ; Example in Scheme (use-modules (srfi srfi-13)) ; returns index of mismatch: 0 (string-compare "hello" "world" values values values) Compare (relational operator-based, Boolean result) % Example in Erlang "hello" > "world". % returns false # Example in Raku "art" gt "painting"; # returns False "art" lt "painting"; # returns True # Example in Windows PowerShell "hello" -gt "world" # returns false ;; Example in Common Lisp (string> "art" "painting") ; returns nil (string< "art" "painting") ; returns non nil Concatenation { Example in Pascal } 'abc' + 'def'; // returns "abcdef" // Example in C# "abc" + "def"; // returns "abcdef" ' Example in Visual Basic "abc" & "def" ' returns "abcdef" "abc" + "def" ' returns "abcdef" "abc" & Null ' returns "abc" "abc" + Null ' returns Null // Example in D "abc" ~ "def"; // returns "abcdef" ;; Example in common lisp (concatenate 'string "abc " "def " "ghi") ; returns "abc def ghi" # Example in Perl 5 "abc" . "def"; # returns "abcdef" "Perl " . 5; # returns "Perl 5" # Example in Raku "abc" ~ "def"; # returns "abcdef" "Perl " ~ 6; # returns "Perl 6" Contains ¢ Example in ALGOL 68 ¢ string in string("e", loc int, "Hello mate"); ¢ returns true ¢ string in string("z", loc int, "word"); ¢ returns false ¢ // Example In C# "Hello mate".Contains("e"); // returns true "word".Contains("z"); // returns false # Example in Python "e" in "Hello mate" # returns true "z" in "word" # returns false # Example in Raku "Good morning!".contains('z') # returns False "¡Buenos días!".contains('í'); # returns True " Example in Smalltalk " 'Hello mate' includesSubstring: 'e' " returns true " 'word' includesSubstring: