Binary strings: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
(add RPL)
m (→‎{{header|Wren}}: Changed to Wren S/H)
(One intermediate revision by one other user not shown)
Line 3,849:
=={{header|RPL}}==
Strings are a sequence of bytes.
 
String creation - no need for destruction as there is a garbage collection mechanism:
String creation:
"This is a new string" <span style="color:grey">@ String is put at stack level 1</span>
String creation - noNo need for destruction as there is a garbage collection mechanism:.
 
String assignment:
"This is a string" '<span style="color:green">MYTEXT</span>' STO <span style="color:grey">@ String is transferred from stack level 1 to MYTEXT variable</span>
String comparison: numeric operators can be used for equality or lexicographic order
"This" "That" == <span style="color:grey">@ test equality - returnreturns 0 here</span>
"This" "That" > <span style="color:grey">@ test order - returns 1 here</span>
Inclusion can also be tested:
Line 4,360 ⟶ 4,363:
 
Setting a string variable to the special value ''null'' means that the variable currently has no value though it can still be assigned one later.
<syntaxhighlight lang="ecmascriptwren">// create string
var s = "abc"
 
Line 4,395 ⟶ 4,398:
t = "def"
var u = s + t // "abcdef"</syntaxhighlight>
 
=={{header|Yabasic}}==
<syntaxhighlight lang="yabasic">// Rosetta Code problem: http://rosettacode.org/wiki/Binary_strings
9,486

edits