forked from solstice/solstice
24 lines
509 B
Markdown
24 lines
509 B
Markdown
# 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"
|
|
``` |