How to get a substring between two indexes of a string in Go

1 Answer

0 votes
package main

import (
	"fmt"
)

func main() {
	s := "c++ python go java"
	start := 2
	end := 6

	fmt.Println(s[start:end])
}


/*
run:

+ py

*/

 



answered Sep 30, 2024 by avibootz

Related questions

1 answer 118 views
1 answer 111 views
1 answer 96 views
1 answer 95 views
...