forked from solstice/solstice
started writing lexer after making string lib
This commit is contained in:
23
string/docs/modify/trim.md
Normal file
23
string/docs/modify/trim.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# string_Trim
|
||||
Trim whitespace from both sides of a string.
|
||||
|
||||
## Arguments
|
||||
- str (string): the string to trim.
|
||||
|
||||
## Returns
|
||||
trimmed (string): the string with its whitespace removed.
|
||||
|
||||
## Raises
|
||||
- `AllocFail`: raised if Ground failed to allocate memory for the new string.
|
||||
|
||||
## Example
|
||||
### Ground
|
||||
```python
|
||||
call !string_Trim " aaabbb " &trimmed
|
||||
println $trimmed # "aaabbb"
|
||||
```
|
||||
|
||||
### Solstice
|
||||
```c
|
||||
puts string_Trim(" aaabbb ") // "aaabbb"
|
||||
```
|
||||
Reference in New Issue
Block a user