Compare length of two strings: Difference between revisions

Content added Content deleted
(→‎{{header|Lua}}: added Lua solution)
(Applesoft BASIC)
Line 435: Line 435:


=={{header|BASIC}}==
=={{header|BASIC}}==
==={{header|Applesoft BASIC}}===
Printing CHR$(14) does nothing by default in Applesoft BASIC. Commodore BASIC appends spaces to numbers, but otherwise the [[Compare_length_of_two_strings#Commodore_BASIC]] code works the same in Applesoft BASIC.
{{out}}
<pre>*** (1) TWO STRINGS ***
LONGER STRING (13)
SHORT STRING (12)


*** (2) MORE THAN 2 STRINGS***
SHE DOESN'T STUDY GERMAN ON MONDAY (34)
EVERY CHILD LIKES AN ICE CREAM (30)
THE COURSE STARTS NEXT SUNDAY (29)
DOES SHE LIVE IN PARIS? (23)
SHE SWIMS EVERY MORNING (23)
THE EARTH IS SPHERICAL (22)
WE SEE THEM EVERY WEEK (22)
HE DOESN'T TEACH MATH (21)
CATS HATE WATER (15)
I LIKE TEA (10)

</pre>
==={{header|Commodore BASIC}}===
==={{header|Commodore BASIC}}===
{{works with|Applesoft BASIC}}
{{works with|Commodore BASIC|2.0}}
{{works with|Commodore BASIC|2.0}}
{{works with|Commodore BASIC|3.5}}
{{works with|Commodore BASIC|3.5}}
Line 620: Line 642:
{{out}}<pre>123456789 9
{{out}}<pre>123456789 9
abcd 4</pre>
abcd 4</pre>



=={{header|Fortran}}==
=={{header|Fortran}}==