code: func getValidPrefix(s string, base int64) string {
  	var (
  		validLen int
  		upper    rune
  	)
  	switch {
  	case base >= 2 && base <= 9:
  		upper = rune('0' + base)
  	case base <= 36:
  		upper = rune('A' + base - 10)
  	default:
  		return ""
  	}
  Loop:
  	for i := 0; i < len(s); i++ {
  		c := rune(s[i])
  		switch {
  		case unicode.IsDigit(c) || unicode.IsLower(c) || unicode.IsUpper(c):
  			c = unicode.ToUpper(c)
  			if c < upper {
  				validLen = i + 1
  			} else {
  				break Loop
  			}
  		case c == '+' || c == '-':
  			if i != 0 {
  				break Loop
  			}
  		default:
  			break Loop
  		}
  	}
  	if validLen > 1 && s[0] == '+' {
  		return s[1:validLen]
  	}
  	return s[:validLen]
  }
docs: // getValidPrefix gets a prefix of string which can parsed to a number with base. the minimum base is 2 and the maximum is 36.