mirror of
https://github.com/zeroflag/fcl.git
synced 2025-01-11 20:01:10 +01:00
Update README.md
This commit is contained in:
parent
6fd704af00
commit
b5002b9f7a
1 changed files with 12 additions and 12 deletions
24
README.md
24
README.md
|
@ -208,51 +208,51 @@ The quotation code is compiled into the enclosing word and bypassed by a jump. A
|
||||||
|
|
||||||
Strings are surrounded by single quotes and they're immutable. For example `'Hello world'`.
|
Strings are surrounded by single quotes and they're immutable. For example `'Hello world'`.
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'hello world' 0 5 substr \ gets the characters from 0 to 5 (exclusive)
|
'hello world' 0 5 substr \ gets the characters from 0 to 5 (exclusive)
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'hello world' 1 at \ gets the first character (as a string)
|
'hello world' 1 at \ gets the first character (as a string)
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'hello' upper \ gets the upper case version of hello
|
'hello' upper \ gets the upper case version of hello
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'HELLO' lower \ gets the lower case version of hello
|
'HELLO' lower \ gets the lower case version of hello
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
' xx ' trim \ removes the leading and trailing spaces from the string
|
' xx ' trim \ removes the leading and trailing spaces from the string
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'abcd' 'bc' index-of \ finds the substring and returns its index, or -1 if not found
|
'abcd' 'bc' index-of \ finds the substring and returns its index, or -1 if not found
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'abcxxdepkcxxk' 'xx' 'yyy' replace \ replace all occurances of 'xx' to 'yyy (the substring is a regexp)
|
'abcxxdepkcxxk' 'xx' 'yyy' replace \ replace all occurances of 'xx' to 'yyy (the substring is a regexp)
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'af' '123' concat \ concatenates two strings
|
'af' '123' concat \ concatenates two strings
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'hello world' ' ' split \ splits the strings into parts by the separator string
|
'hello world' ' ' split \ splits the strings into parts by the separator string
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
123 >str \ conversts the number into a string
|
123 >str \ conversts the number into a string
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
"[ 1 'xx' ] 'a=%d b=%s' format" \ creates a string using the given format by substituting the parts in place of the format characters.
|
"[ 1 'xx' ] 'a=%d b=%s' format" \ creates a string using the given format by substituting the parts in place of the format characters.
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```
|
||||||
'ab' 3 * \ copies the string n times
|
'ab' 3 * \ copies the string n times
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue