Function with multiple parameters
package main
import (
"fmt"
)
func main() {
printSubstring("The black cat climbed the green tree", 10, 13)
}
func printSubstring(text string, start, end int) {
fmt.Println(text[start:end])
}
cat
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
package main
import (
"fmt"
)
func main() {
printSubstring("The black cat climbed the green tree", 10, 13)
}
func printSubstring(text string, start, end int) {
fmt.Println(text[start:end])
}
cat