Compare length of two strings: Difference between revisions
Content added Content deleted
(Compare length of two strings in various BASIC dialents (BASIC256, PureBasic, QBasic, Run BASIC, True BASIC and Yabasic)) |
(Compare length of two strings in Asymptote) |
||
Line 90: | Line 90: | ||
3 abc |
3 abc |
||
</lang> |
</lang> |
||
=={{header|Asymptote}}== |
|||
<lang Asymptote>string A, B, t = '\t'; |
|||
void comp(string A, string B) { |
|||
if (length(A) >= length(B)) { |
|||
write(A+t, length(A)); |
|||
write(B+t, length(B)); |
|||
} else { |
|||
write(B+t, length(B)); |
|||
write(A+t, length(A)); |
|||
} |
|||
} |
|||
comp("abcd", "123456789");</lang> |
|||
{{out}} |
|||
<pre>123456789 9 |
|||
abcd 4</pre> |
|||
=={{header|AutoHotkey}}== |
=={{header|AutoHotkey}}== |