Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/Substring/Liberty-BASIC/substring.basic
Normal file
22
Task/Substring/Liberty-BASIC/substring.basic
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
'These tasks can be completed with various combinations of Liberty Basic's
|
||||
'built in Mid$()/ Instr()/ Left$()/ Right$()/ and Len() functions, but these
|
||||
'examples only use the Mid$()/ Instr()/ and Len() functions.
|
||||
|
||||
baseString$ = "Thequickbrownfoxjumpsoverthelazydog."
|
||||
n = 12
|
||||
m = 5
|
||||
|
||||
'starting from n characters in and of m length
|
||||
Print Mid$(baseString$, n, m)
|
||||
|
||||
'starting from n characters in, up to the end of the string
|
||||
Print Mid$(baseString$, n)
|
||||
|
||||
'whole string minus last character
|
||||
Print Mid$(baseString$, 1, (Len(baseString$) - 1))
|
||||
|
||||
'starting from a known character within the string and of m length
|
||||
Print Mid$(baseString$, Instr(baseString$, "f", 1), m)
|
||||
|
||||
'starting from a known substring within the string and of m length
|
||||
Print Mid$(baseString$, Instr(baseString$, "jump", 1), m)
|
||||
Loading…
Add table
Add a link
Reference in a new issue