Compare length of two strings: Difference between revisions
Content added Content deleted
(PascalABC.NET) |
|||
Line 2,149: | Line 2,149: | ||
begin |
begin |
||
var (s1,s2) := ('Bye','Hello'); |
var (s1,s2) := ('Bye','Hello'); |
||
if s1.Length |
if s1.Length < s2.Length then |
||
Swap(s1,s2); |
Swap(s1,s2); |
||
Println(s1,s1.Length); |
Println(s1,s1.Length); |
||
Line 2,160: | Line 2,160: | ||
{{out}} |
{{out}} |
||
<pre> |
<pre> |
||
⚫ | |||
Bye 3 |
Bye 3 |
||
⚫ | |||
crocodile - 9 |
crocodile - 9 |
||
Line 2,168: | Line 2,168: | ||
cat - 3 |
cat - 3 |
||
</pre> |
</pre> |
||
=={{header|Perl}}== |
=={{header|Perl}}== |