# returns "My pen costs $19.99" "My {0} costs ${1:.2f}".format("pen", 19.99); # returns "My pen costs $19.99"#Example in Python 3.6+ pen = "pen" f"My {pen} costs {19.99}" #returns "My pen costs 19.99" ; Example in Scheme (format "My ~a costs $~1,2F" "pen" 19.99) ; returns "My pen costs $19.99" /* example in PL/I */ put string(some_string) edit('My ', 'pen', ' costs', 19.99)(a,a,a,p'$$$V.99') /* returns "My pen costs $19.99" */ Inequality Tests if two strings are not equal. See also #Equality. // Example in C# "hello" != "world" // returns true ' Example in Visual Basic "hello" <> "world" ' returns true ;; Example in Clojure (not= "hello" "world") ; ⇒ true # Example in Perl 5 'hello' ne 'world' # returns 1 # Example in Raku 'hello' ne 'world' # returns True # Example in Windows PowerShell "hello" -ne "world" # returns true index see #Find indexof see #Find instr see #Find instrrev see #rfind join // Example in C# String.Join("-", {"a", "b", "c"}) // "a-b-c" " Example in Smalltalk " #('a' 'b' 'c') joinUsing: '-' " 'a-b-c' " # Example in Perl 5 join( '-', ('a', 'b', 'c')); # 'a-b-c' # Example in Raku <a b c>.join('-'); # 'a-b-c' # Example in Python "-".join(["a", "b", "c"]) # 'a-b-c' # Example in Ruby ["a", "b", "c"].join("-") # 'a-b-c' ; Example in Scheme (use-modules (srfi srfi-13)) (string-join '("a" "b" "c") "-") ; "a-b-c" lastindexof see #rfind left # Example in Raku "Hello, there!".substr(0, 6); # returns "Hello," /* Examples in Rexx */ left("abcde", 3) /* returns "abc" */ left("abcde", 8) /* returns "abcde " */ left("abcde", 8, "*") /* returns "abcde***" */ ; Examples in Scheme (use-modules (srfi srfi-13)) (string-take "abcde", 3) ; returns "abc" (string-take "abcde", 8) ; error ' Examples in Visual Basic Left("sandroguidi", 3) ' returns "san" Left("sandroguidi", 100) ' returns "sandroguidi" len see #length length // Examples in C# "hello".Length; // returns 5 "".Length; // returns 0 # Examples in Erlang string:len("hello"). % returns 5 string:len(""). % returns 0 # Examples in Perl 5 length("hello"); # returns 5 length(""); # returns 0 # Examples in Raku "🏳️‍🌈".chars; chars "🏳️‍🌈"; # both return 1 "🏳️‍🌈".codes; codes "🏳️‍🌈"; # both return 4 "".chars; chars ""; # both return 0 "".codes; codes ""; # both return 0 ' Examples in Visual Basic Len("hello") ' returns 5 Len("") ' returns 0 //Examples in Objective-C [@"hello" Length] //returns 5 [@"" Length] //returns