// GetNumBase scans the given string for its numeric base. If num starts with
// '0x' base 16 is assumed. Just '0' assumes base 8.
GetNumBase scans the given string for its numeric base. If num starts with
'0x' base 16 is assumed. Just '0' assumes base 8.
// GetNumBase scans the given string for its numeric base . If num starts with // ' 0x ' base 16 is assumed . Just ' 0 ' assumes base 8 .
func GetNumBase(num string) (string, int) {
	switch {
	case len(num) == 0:
		return num, 10
	case len(num) > 1 && num[0] == '0':
		if num[1] == 'x' {
			return num[2:], 16
		}
		return num[1:], 8
	}
	return num, 10
}
func GetNumBase ( num string ) ( string , int ) { switch { case len ( num ) == 0 : return num , 10 case len ( num ) > 1 && num [ 0 ] == '0' : if num [ 1 ] == 'x' { return num [ 2 : ] , 16 } return num [ 1 : ] , 8 } return num , 10 }
GetNumBase scans the given string for its numeric base.
GetNumBase scans the given string for its numeric base .