Jump to content

Compare length of two strings: Difference between revisions

Undo revision 357306 by Chkas (talk)
(Undo revision 357306 by Chkas (talk))
Line 1,228:
 
=={{header|EasyLang}}==
<syntaxhighlight lang="easylang">
proc scmpstringLength a$ b$ . .
iflineA$ len= "\"" & a$ <& "\" (length: " & len ba$ & ")"
printlineB$ = "\"" & b$ & "\" -(length: " & len b$ & ")"
if swaplen a$ >= len b$
print lineA$ ; print lineB$
else
print lineB$ ; print lineA$
.
print a$ & " - " & len a$
print b$ & " - " & len b$
print ""
.
call scmpstringLength "Easy" "Language"
call scmpstringLength "Rosetta" "Code"
</syntaxhighlight>
{{out}}
<pre>
"Language" (length: 8)
"Easy" (length: 4)
"Rosetta" (length: 7)
"Code" (length: 4)
</pre>
 
=={{header|EMal}}==
2,078

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.