Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
26
Task/Binary-strings/PureBasic/binary-strings.basic
Normal file
26
Task/Binary-strings/PureBasic/binary-strings.basic
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
;string creation
|
||||
x$ = "hello world"
|
||||
|
||||
;string destruction
|
||||
x$ = ""
|
||||
|
||||
;string comparison
|
||||
If x$ = "hello world" : PrintN("String is equal") : EndIf
|
||||
|
||||
;string copying;
|
||||
y$ = x$
|
||||
|
||||
; check If empty
|
||||
If x$ = "" : PrintN("String is empty") : EndIf
|
||||
|
||||
; append a byte
|
||||
x$ = x$ + Chr(41)
|
||||
|
||||
; extract a substring
|
||||
x$ = Mid(x$, 1, 5)
|
||||
|
||||
; replace bytes
|
||||
x$ = ReplaceString(x$, "world", "earth")
|
||||
|
||||
; join strings
|
||||
x$ = "hel" + "lo w" + "orld"
|
||||
Loading…
Add table
Add a link
Reference in a new issue