Binary strings: Difference between revisions
Content added Content deleted
MaiconSoft (talk | contribs) No edit summary |
No edit summary |
||
Line 249: | Line 249: | ||
REM JOIN STRINGS |
REM JOIN STRINGS |
||
J$ = A$ + STR$(42) + " PUDDLES " + B$ + CHR$(255) : REM USE +</lang> |
J$ = A$ + STR$(42) + " PUDDLES " + B$ + CHR$(255) : REM USE +</lang> |
||
==={{header|IS-BASIC}}=== |
|||
<lang IS-BASIC>100 RANDOMIZE |
|||
110 REM create two strings |
|||
120 LET S$="Hello":LET T$="Bob" |
|||
130 REM choose any random character |
|||
140 LET C=(RND(127)+32) |
|||
150 REM add the character to the string |
|||
160 LET S$=S$&CHR$(C) |
|||
170 REM check if the string is empty |
|||
180 IF S$="" THEN PRINT "String is empty" |
|||
190 REM compare two strings |
|||
200 IF S$=T$ THEN PRINT "Strings are the same." |
|||
210 REM print characters 2 to 4 of a string (a substring) |
|||
220 PRINT S$(2:4)</lang> |
|||
==={{header|ZX Spectrum Basic}}=== |
==={{header|ZX Spectrum Basic}}=== |