Compare length of two strings: Difference between revisions
Content added Content deleted
(Add Scala implementation) |
RandomTask (talk | contribs) |
||
Line 1,118: | Line 1,118: | ||
</pre> |
</pre> |
||
=={{header|C sharp|C#}}== |
=={{header|C sharp|C#}}== |
||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
using System; |
|||
using System.Collections.Generic; |
using System.Collections.Generic; |
||
Line 1,163: | Line 1,164: | ||
} |
} |
||
} |
} |
||
} |
} |
||
} |
} |
||
Line 1,169: | Line 1,169: | ||
{{output}} |
{{output}} |
||
<pre> |
|||
"123456789" has length 9 and is the longest string |
|||
"1234567" has length 7 and is neither the longest nor the shortest string |
"1234567" has length 7 and is neither the longest nor the shortest string |
||
"abcdef" has length 6 and is neither the longest nor the shortest string |
"abcdef" has length 6 and is neither the longest nor the shortest string |