char[] | C |
char const[] | C++ |
string | C#, C++, Maple, OCaml, Pascal, Pike, YCP |
string! | Rebol |
String | Ada, C#, Haskell, Java, JavaScript, merd, Smalltalk, Visual Basic |
STRING | Eiffel |
str | YAML |
Str | Perl6, Pliant |
NSString * | Objective-C |
CHAR, VARCHAR(size) | SQL92 |
char | C, C#, C++, OCaml |
char! | Rebol |
Char | Haskell, merd, Perl6 |
Character | Ada, Smalltalk |
CHARACTER | Eiffel |
'z' | Ada, B, C, C#, C++, Classic REXX, E, Eiffel, Haskell, Matlab, OCaml, Pascal, Pike |
"z" | BourneShell, Classic REXX, Maple, merd |
"z | Logo |
$z | Smalltalk |
#\z | Common Lisp, Scheme |
#"z" | Rebol |
&z | Oz |
?z | Emacs Lisp, Ruby |
verbatim
'...' | Beta, BourneShell, Classic REXX, JavaScript, Lua, Matlab, Pascal, Perl, Perl6, PHP, Prolog, Python, Ruby, Smalltalk, SQL92, XPath, YAML |
"..." | Ada, Awk, C, C#, C++, Classic REXX, Common Lisp, Dylan, E, Eiffel, Emacs Lisp, FL, Haskell, Java, JavaScript, Lua, Maple, Modula-3, MUMPS, OCaml, Oz, Pike, Pliant, Prolog, Python, Rebol, Scheme, SML, XPath, YAML, YCP |
"... | Logo |
'''...''', """...""" | Python |
[[ ... ]] | Lua |
<<'MARK' ... MARK | BourneShell, Perl, Ruby |
{...{...}...} | Tcl |
(...) | PostScript |
q(...(...)...), q[...], q{...}, q<...>, q/.../ | Perl, Perl6 |
%q(...(...)...), %q[...], %q{...}, %q<...>, %q/.../ | Ruby |
q(...(...)...) | merd |
@"...""..." | C# |
@"..." | Objective-C |
with interpolation
"... $v ..." | BourneShell, Perl, Perl6, PHP, Tcl |
"... {v} ..." | merd |
"... #{v} ..." "... #$v ..." "... #@v ..." "... #@@v ..." | Ruby |
<<MARK ... $v ... MARK | BourneShell, Perl |
<<MARK ... #{v} ... MARK | Ruby |
<<<MARK ... $v ... MARK | PHP |
[ subst {...{... $v ...}...} ] | Tcl |
qq(...(... $v ...)...), qq[...], qq{...}, qq<...>, qq/.../ | Perl, Perl6 |
%Q(...(... #{v} ...)...), %Q[...], %Q{...}, %Q<...>, %Q/.../ | Ruby |
qq(...(... {v} ...)...) | merd |
"... %(v)s ..." % vars() | Python |
end-of-line (without writing the real CR or LF character)
"\n" | C, C#, C++, Java, JavaScript, Lua, Maple, OCaml, Perl, Perl6, Pike, Python, Ruby, YCP, Yorick |
"*n" | B, BCPL |
"%N" | Eiffel |
"^/" | Rebol |
"~%" | Common Lisp |
"[lf]" | Pliant |
vb_nl | Visual Basic |
all strings allow multi-line strings | Common Lisp, E, Emacs Lisp, Maple, OCaml, Pascal, Perl, Perl6, Ruby, Scheme, YCP |
@"..." | C# |
'''...''', """...""" | Python |
[[ ... ]] | Lua |
{...} | Rebol |
"...\n" "...\n" |
C |
... "...\n\ \...\n" |
Haskell |
"...", "..." |
Classic REXX |
"...%N% %...%N" |
Eiffel |
show | Haskell |
to_s, to_str, inspect, String() | Ruby |
to_string | merd, Pliant |
tostring | Lua, YCP |
toString | Java, JavaScript |
ToString | C# |
String | JavaScript |
perl | Perl6 |
Dumper | Perl |
"" . e | Perl |
"" ~ e | Perl6 |
"" + e | E, Java, JavaScript |
string | Pliant |
str, `e`, repr | Python |
out | Eiffel |
cvs | PostScript |
'Image | Ada |
asString printString | Smalltalk |
as(<string>, e) | Dylan |
(string) e | Pike |
convert(e,string) | Maple |
(coerce e 'string) | Common Lisp |
prin1-to-string | Emacs Lisp |
to string! / to-string / to "" | Rebol |
description | Objective-C |
export-clixml | MSH |
Marshal.to_string | OCaml |
Marshal.dump | Ruby |
import-clixml | MSH |
Marshal.from_string | OCaml |
Marshal.load | Ruby |
sprintf | Awk, C, C++, Maple, Matlab, merd, OCaml, Perl, Perl6, PHP, Pike, Ruby |
% | Python, Ruby |
format | Common Lisp, Erlang, Scheme-SRFI28 |
Format | C# |
putFormat | Beta |
stringWithFormat | Objective-C |
on strings
puts | C, Dylan |
Awk, Basic, Java, Maple, merd, PHP, SML | |
write | JavaScript, Pascal, Pike, Yorick |
putStr | Haskell |
print_string | OCaml |
console | Pliant |
writeln | JavaScript, Pascal |
write-string | Common Lisp |
putStrLn | Haskell |
Put_Line | Ada |
display | Cobol |
message | Emacs Lisp |
put_string | Eiffel |
show | Smalltalk |
print_endline | OCaml |
println | Java, merd |
put_chars | Erlang |
echo | BourneShell, PHP |
emit | Forth |
putText | Beta |
say | Classic REXX |
on simple objects
Perl, Perl6 | |
say | Perl6 |
puts | Tcl |
on any objects
Logo, Ruby | |
Dylan, Haskell, Python, Rebol | |
prin | Rebol |
Put | Ada |
p | Ruby |
puts | Ruby |
display | Scheme |
write | Common Lisp, Prolog, Scheme |
Common Lisp | |
princ prin1 | Common Lisp, Emacs Lisp |
WriteLine | C# |
nothing - just remove ";" at the end of the expression, and it will print it | Matlab |
disp | Matlab |
printf-like
printf | Awk, C, C++, Maple, Matlab, merd, OCaml, Perl, PHP, Ruby |
write | Pike |
WriteLine | C# |
putFormat | Beta |
format | Common Lisp, Prolog |
eq ne | Perl, Perl6, Tcl |
strcmp | C, Matlab |
== != | JavaScript, Pike |
isEqualToString | Objective-C |
= \= | Prolog |
== != | Awk, C#, C++, E, merd, Python, Ruby, YCP |
== /= | Haskell |
== \= | Oz |
= != | BourneShell, Maple, XPath |
= /= | Ada |
= \= | Classic REXX |
= <> | Beta, OCaml, Pliant, SML, Visual Basic |
= ~= | Dylan, Smalltalk |
== \== or = <> \= | Classic REXX |
== ~= | Matlab |
equal? | Ruby, Scheme |
equals | Java |
equal, equalp | Common Lisp |
is_equal | Eiffel |
isEqual | Objective-C |
length | Awk, Beta, C++, Common Lisp, Eiffel, Haskell, Java, JavaScript, Maple, Matlab, Objective-C, OCaml, Perl, PostScript, Prolog, Ruby |
LENGTH | Classic REXX |
'Length | Ada |
length? | Rebol |
size | C++, E, Ruby, Smalltalk, SML, YCP |
Length | C#, Modula-3, Oz, Pascal |
len | Pliant, Python, Visual Basic |
strlen | C, PHP |
string-length | Scheme, XPath |
sizeof | Pike |
count | Eiffel, Logo |
bytes chars | Perl6 |
CHARACTER_LENGTH | SQL92 |
atom_length | Prolog |
+ | C#, C++, E, Eiffel, Java, JavaScript, merd, MSH, Pascal, Pike, Pliant, Python, Ruby, YCP |
. | Perl, PHP |
, | Smalltalk |
.. | Lua |
~ | Perl6 |
& | Ada, Modula-3, Visual Basic |
^ | OCaml, SML |
_ | MUMPS |
|| | Cecil, Classic REXX, Icon, Maple, PL/I, SQL92 |
++ | Haskell |
$a$b | BourneShell, Tcl |
concatenate | Common Lisp, Dylan |
string-append | Scheme |
cat | Maple |
Cat | Modula-3 |
strcat | C |
concat | XPath |
append | Beta, Prolog, Rebol |
stringByAppendingString | Objective-C |
Awk, Classic REXX | |
[string1 string2] | Matlab |
word | Logo |
* | Ada, E, Pike, Python, Ruby |
x | Perl, Perl6 |
times | merd |
repeat | Pliant |
str_repeat | PHP |
string repeat | Tcl |
strrep | Lua |
repmat | Matlab |
insert/dup | Rebol |
COPIES | Classic REXX |
cat(s$n) | Maple |
upcase / downcase | Emacs Lisp, Ruby |
uc / lc | Perl, Perl6 |
upper / lower | Lua, Matlab, Pliant, Python |
toUpper / toLower | Haskell |
to_upper / to_lower | Eiffel |
To_Upper / To_Lower | Ada |
toUpperCase / toLowerCase | E, Java, JavaScript |
upper_case / lower_case | Pike |
uppercase / lowercase | Logo, OCaml |
strupper / strlower | Lua |
ToUpper / ToLower | C#, Oz |
toupper / tolower | Awk, C, C++ |
string toupper / string tolower | Tcl |
asLowercase / asUppercase | Smalltalk |
upCase / lowCase | Beta |
uppercase form / lowercase form | Rebol |
char-upcase / char-downcase | Common Lisp, Scheme |
char_type(C_, to_upper(C)), char_type(C_, to_lower(C)) | Prolog |
upcase / downcase | Emacs Lisp, Ruby |
upper / lower | Matlab, Python, SQL92 |
uppercase/lowercase | Logo, OCaml, Rebol |
upcase_atom/downcase_atom | Prolog |
toUpperCase / toLowerCase | E, Java, JavaScript |
ToUpper / ToLower | C# |
to_upper / to_lower | Ada, Eiffel |
toupper / tolower | Awk, YCP |
uc / lc | Perl, Perl6 |
UpperCase / LowerCase | Pascal |
StringTools[UpperCase] / StringTools[LowerCase] / StringTools[Capitalize] | Maple |
uppercaseString / lowercaseString / capitalizedString | Objective-C |
UCase / LCase | Visual Basic |
strtoupper / strtolower | PHP |
strupper / strlower | Lua |
string toupper / string tolower | Tcl |
string-upcase / string-downcase | Common Lisp, Scheme |
asLowercase / asUppercase | Smalltalk |
upcase_atom / downcase_atom | Prolog |
makeLC / makeUC | Beta |
parse upper var in_var out_var / parse lower var in_var out_var | Classic REXX |
chr | Haskell, OCaml, Pascal, Perl, Perl6, PHP, Python, Ruby, SML |
chr$ | Visual Basic |
char | Matlab |
format %c $c | Tcl |
toChar | E |
strchar | Lua |
from_integer | Eiffel |
fromCharCode | JavaScript |
character | Pliant |
Character value: c | Smalltalk |
code-char | Common Lisp |
integer->char | Scheme |
'Val | Ada |
(char) c | C, C#, C++, Java |
to char! / to-char | Rebol |
X2C, D2C | Classic REXX |
$CHAR(s) | MUMPS |
char_code | Prolog |
ascii | Logo |
StringTools[Char] | Maple |
ord | Haskell, Pascal, Perl, Perl6, PHP, Python, SML |
asc | Visual Basic |
getNumericValue | Java |
charCodeAt | JavaScript |
asciiValue | Smalltalk |
code | Eiffel, OCaml |
char-code | Common Lisp |
char->integer | Scheme |
s[0] | Ruby |
s 0 get | PostScript |
scan $s %c | Tcl |
strbyte | Lua |
toInteger | E |
'Pos | Ada |
number | Pliant |
(int) c | C, C#, C++, Java |
to integer! / to-integer | Rebol |
C2X, C2D | Classic REXX |
$ASCII(s) | MUMPS |
(done automatically when applying mathematical operations on char, such as +) | Matlab |
char | Logo |
char_code | Prolog |
StringTools[Ord] | Maple |
s[n] | C, C#, C++, E, Maple, PHP, Pike, Python, Ruby |
s(n) | Ada, Matlab |
s:n | Pliant |
s.[n] | OCaml |
s !! n | Haskell |
s @ n | Eiffel |
s/:n | Rebol |
string index s n | Tcl |
sub | SML |
char, aref, schar, svref | Common Lisp |
GetChar | Modula-3 |
at | C++, Smalltalk |
aref | Common Lisp |
char(s, i) | B |
charAt | Java, JavaScript |
characterAtIndex | Objective-C |
n -> s.inxGet | Beta |
string-ref | Scheme |
$EXTRACT(s, n) | MUMPS |
item | Logo |
s[n..m] | Maple, Pike, Ruby |
s(n..m) | Ada |
s(n:m) | Matlab |
s(n,m+1) | E |
s[n:m+1] | Python |
s[n,len] | Ruby |
s n len | Pliant |
strndup(s + n, len) | C |
substring | Eiffel, Java, Scheme, SML, XPath, YCP |
Substring | C# |
substr | C++, Perl, Perl6, PHP |
SUBSTR | Classic REXX |
sub | OCaml |
SUB | Modula-3 |
subseq | Common Lisp |
slice | JavaScript |
mid$ | JavaScript |
range | Tcl |
copy/part at s n len | Rebol |
copy/part at s n at s m | Rebol |
s copyFrom: n to: m | Smalltalk |
(n,m)->s.sub | Beta |
[s substringWithRange:NSMakeRange(n, len)] | Objective-C |
SUBSTRING(s FROM n len) | SQL92 |
$EXTRACT(s, n, m) | MUMPS |
sub_string / sub_atom | Prolog |
index | Ada, C, Perl, Perl6, Python, Ruby |
indexOf | Java, JavaScript |
IndexOf | C# |
startOf | E |
search | Common Lisp, Pike, PostScript |
StringTools[Search] | Maple |
strstr strchr | C |
find | Logo, Python, Rebol, YCP |
strfind | Matlab |
$FIND | MUMPS |
index_non_blank / find_token | Ada |
substring_index | Eiffel |
rangeOfString | Objective-C |
POS | Classic REXX |
POSITION(needle IN s) | SQL92 |
sub_string / sub_atom | Prolog |
rindex | C, OCaml, Perl, Perl6, Python, Ruby |
rfind | C++, Python |
find/last | Rebol |
strrchr | C |
index(Going => Backward) | Ada |
lastStartOf | E |
lastIndexOf | Java, JavaScript |
last_index_of | Eiffel |
LastIndexOf | C# |
(search substring string :from-end t) | Common Lisp |
[string rangeOfString:substring options:NSBackwardsSearch] | Objective-C |
LASTPOS | Classic REXX |
t=strfind(s,p), t(end) | Matlab |
StringTools[SearchAll](s,p)[-1] | Maple |