Compare length of two strings: Difference between revisions

Content added Content deleted
(Add Scala implementation)
Line 1,118: Line 1,118:
</pre>
</pre>
=={{header|C sharp|C#}}==
=={{header|C sharp|C#}}==
<syntaxhighlight lang="csharp">using System;
<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>
<pre>"123456789" has length 9 and is the longest string
"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