forked from solstice/solstice
started writing lexer after making string lib
This commit is contained in:
24
string/docs/modify/repeat.md
Normal file
24
string/docs/modify/repeat.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# string_Repeat
|
||||
Repeat a string `times` times.
|
||||
|
||||
## Arguments
|
||||
- str (string): the string to repeat.
|
||||
- times (int): the number of times to repeat the string.
|
||||
|
||||
## Returns
|
||||
result (string): the string repeated the given number of times.
|
||||
|
||||
## Raises
|
||||
- `AllocFail`: raised if Ground fails to allocate memory for the new string.
|
||||
|
||||
## Example
|
||||
### Ground
|
||||
```python
|
||||
call !string_Repeat "hi " 5 &repeated
|
||||
println $repeated # "hi hi hi hi hi "
|
||||
```
|
||||
|
||||
### Solstice
|
||||
```c
|
||||
puts string_Repeat("hi ", 5) // "hi hi hi hi hi "
|
||||
```
|
||||
Reference in New Issue
Block a user