Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Substring/PureBasic/substring.basic
Normal file
27
Task/Substring/PureBasic/substring.basic
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
If OpenConsole()
|
||||
|
||||
Define baseString.s, m, n
|
||||
|
||||
baseString = "Thequickbrownfoxjumpsoverthelazydog."
|
||||
n = 12
|
||||
m = 5
|
||||
|
||||
;Display the substring starting from n characters in and of m length.
|
||||
PrintN(Mid(baseString, n, m))
|
||||
|
||||
;Display the substring starting from n characters in, up to the end of the string.
|
||||
PrintN(Mid(baseString, n)) ;or PrintN(Right(baseString, Len(baseString) - n))
|
||||
|
||||
;Display the substring whole string minus last character
|
||||
PrintN(Left(baseString, Len(baseString) - 1))
|
||||
|
||||
;Display the substring starting from a known character within the string and of m length.
|
||||
PrintN(Mid(baseString, FindString(baseString, "b", 1), m))
|
||||
|
||||
;Display the substring starting from a known substring within the string and of m length.
|
||||
PrintN(Mid(baseString, FindString(baseString, "ju", 1), m))
|
||||
|
||||
Print(#CRLF$ + #CRLF$ + "Press ENTER to exit")
|
||||
Input()
|
||||
CloseConsole()
|
||||
EndIf
|
||||
Loading…
Add table
Add a link
Reference in a new issue