Skip to content

Latest commit

 

History

History
47 lines (46 loc) · 5.04 KB

strings.md

File metadata and controls

47 lines (46 loc) · 5.04 KB

Documentation

Strings

String are identified by :, their name must be composed by lowercase and or uppercase letters and must not contain symbols or numbers. Each string is just an entry of a global array of strings. BIPLAN supports up to 88 strings of 2^31 or 2^63 bits length. A string can be declared:

:test = "Hello world!"

A string can be accessed by name:

:test = "Hello world!"
print :test // Prints "Hello world!"

Strings can be concatenated:

:name = "Fred"
:phrase = "Hi " + :name + "!" // Prints "Hi Fred!"

All strings can be accessed by reference using :[]:

:test = "Hello world!"
print :[0] // Prints "Hello world!"

Characters of strings can be accessed as shown below:

:test = "Hello world!"
print :test[0] // Prints "H"

The reference of a string can be obtained prepending its name with index:

:a_string = "Hello world" // index 0
:b_string = "World"       // index 1
:c_string = "Hello"       // index 2
print index :c_string     // Prints 2 or the index of :c_string