Strings / Find string in another string / Essentia

Run Settings
LanguageGo
Language Version
Run Command
package main import ( "fmt" "strings" ) func main() { s := "where hello is?" toFind := "hello" idx := strings.Index(s, toFind) fmt.Printf("'%s' is in s starting at position %d\n", toFind, idx) // when string is not found, result is -1 idx = strings.Index(s, "not present") fmt.Printf("Index of non-existent substring is: %d\n", idx) }
Editor Settings
Theme
Key bindings
Full width
Lines