forked from solstice/solstice
started writing lexer after making string lib
This commit is contained in:
24
string/docs/char_at.md
Normal file
24
string/docs/char_at.md
Normal file
@@ -0,0 +1,24 @@
|
||||
# string_CharAt
|
||||
Get character at index in string.
|
||||
|
||||
## Arguments
|
||||
- str (string): string to get character of.
|
||||
- index (int): the index in the string you want to get.
|
||||
|
||||
## Returns
|
||||
char (string): the character at the specified index in the string.
|
||||
|
||||
## Raises
|
||||
- `OutOfBounds`: raised if you try accessing a string past its length or at a negative index.
|
||||
|
||||
## Example
|
||||
### Ground
|
||||
```python
|
||||
call !string_CharAt "my string" 3 &char
|
||||
println $char # "s"
|
||||
```
|
||||
|
||||
### Solstice
|
||||
```c
|
||||
puts string_CharAt("my string", 3) // "s"
|
||||
```
|
||||
Reference in New Issue
Block a user