Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
15
Task/Binary-strings/BBC-BASIC/binary-strings.basic
Normal file
15
Task/Binary-strings/BBC-BASIC/binary-strings.basic
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
A$ = CHR$(0) + CHR$(1) + CHR$(254) + CHR$(255) : REM assignment
|
||||
B$ = A$ : REM clone / copy
|
||||
IF A$ = B$ THEN PRINT "Strings are equal" : REM comparison
|
||||
IF A$ = "" THEN PRINT "String is empty" : REM Check if empty
|
||||
A$ += CHR$(128) : REM Append a byte
|
||||
S$ = MID$(A$, S%, L%) : REM Extract a substring
|
||||
C$ = A$ + B$ : REM Join strings
|
||||
|
||||
REM To replace every occurrence of a byte:
|
||||
old$ = CHR$(1)
|
||||
new$ = CHR$(5)
|
||||
REPEAT
|
||||
I% = INSTR(A$, old$)
|
||||
IF I% MID$(A$, I%, 1) = new$
|
||||
UNTIL I% = 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue