Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
35
Task/Binary-strings/Wren/binary-strings.wren
Normal file
35
Task/Binary-strings/Wren/binary-strings.wren
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
// create string
|
||||
var s = "abc"
|
||||
|
||||
// destroy string (not really see notes above)
|
||||
s = null
|
||||
|
||||
// (re)assignment
|
||||
s = "def"
|
||||
|
||||
// comparison (only == && != supported directly)
|
||||
var b = (s == "abc") // false
|
||||
|
||||
// cloning/copying
|
||||
var t = s
|
||||
|
||||
// check if empty
|
||||
s = ""
|
||||
b = (s != "") // false
|
||||
b = s.isEmpty // true
|
||||
|
||||
// append a byte
|
||||
s = s + "b"
|
||||
|
||||
// extract a substring
|
||||
s = "ghijkl"
|
||||
t = s[1..4] // "hijk"
|
||||
|
||||
// replace a byte or string
|
||||
s = "abracadabra"
|
||||
s = s.replace("a", "z") // "zbrzczdzbrz"
|
||||
|
||||
// join strings
|
||||
s = "abc"
|
||||
t = "def"
|
||||
var u = s + t // "abcdef"
|
||||
Loading…
Add table
Add a link
Reference in a new issue