// BetweenStrings returns string between first and second string.
BetweenStrings returns string between first and second string.
// BetweenStrings returns string between first and second string .
func BetweenStrings(value, first, second string) (string, error) {
	posFirst := strings.Index(value, first)
	if posFirst == -1 {
		return "", fmt.Errorf("string '%s' doesn't contain first string '%s'", value, first)
	}
	posSecond := strings.Index(value, second)
	if posSecond == -1 {
		return "", fmt.Errorf("string '%s' doesn't contain second string '%s'", value, second)
	}
	posFirstAdjusted := posFirst + len(first)
	if posFirstAdjusted >= posSecond {
		return "", fmt.Errorf("second string '%s' is before first string '%s' in string '%s'", second, first, value)
	}
	return value[posFirstAdjusted:posSecond], nil
}
func BetweenStrings ( value , first , second string ) ( string , error ) { posFirst := strings . Index ( value , first ) if posFirst == - 1 { return " " , fmt . Errorf ( " " , value , first ) } posSecond := strings . Index ( value , second ) if posSecond == - 1 { return " " , fmt . Errorf ( " " , value , second ) } posFirstAdjusted := posFirst + len ( first ) if posFirstAdjusted >= posSecond { return " " , fmt . Errorf ( " " , second , first , value ) } return value [ posFirstAdjusted : posSecond ] , nil }
BetweenStrings returns string between first and second string.
BetweenStrings returns string between first and second string .