Standard library / strings
strings.LastIndexAny()
Returns the byte offset of the last rune in chars, or -1. Expected stdout: '1\n'.
Formal Syntax & Structure
go syntaxgo
func LastIndexAny(s, chars string) intParameters & Attributes
| Name | Type | Description |
|---|---|---|
| s | string | Input text or sequence. |
| chars | string | Set of Unicode code points to match. |
Return Value
int
Returns the byte offset of the last rune in chars, or -1.
Working Example
Example Snippetgo
package main
import ( "fmt" "strings")
func main() { fmt.Println(strings.LastIndexAny("aéa", "é"))}