Count Letter
count_letterCount occurrences of a specific letter in text, returning positions, visual breakdown, and density percentage.
Instructions
Count occurrences of a specific letter in text.
Returns the count, positions, a visual breakdown showing where each letter appears, and a density percentage.
Args:
text (string): The text to analyze
letter (string): The single letter to count
case_sensitive (boolean): Whether to match case exactly (default: false)
Returns: count, positions array, visual breakdown, and density summary.
Example: count_letter("strawberry", "r") → count: 3, positions: [2, 5, 8]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | The text to analyze | |
| letter | Yes | The letter to count | |
| case_sensitive | No | Match case exactly |