forked from solstice/solstice
21 lines
427 B
Markdown
21 lines
427 B
Markdown
# string_Count
|
|
Count the number of times `needle` appears in `haystack`.
|
|
|
|
## Arguments
|
|
- haystack (string): the string to search through.
|
|
- needle (string): the substring to count.
|
|
|
|
## Returns
|
|
count (int): the number of times `needle` appears in `haystack`.
|
|
|
|
## Example
|
|
### Ground
|
|
```python
|
|
call !string_Count "Hello, World!" "l" &count
|
|
println $count # 3
|
|
```
|
|
|
|
### Solstice
|
|
```c
|
|
puts string_Count("Hello, World!", "l") // 3
|
|
``` |