/// <summary> /// To decimalism /// </summary> /// <param name="scaleStr"></param> /// <param name="fromStyle"></param> /// <returns></returns> public static int CastToDecimalism(this string scaleStr, ScaleStyles fromStyle = ScaleStyles.Hexadecimal) { return(fromStyle switch { ScaleStyles.Binary => BinaryConverter.ToDecimalism(scaleStr), ScaleStyles.Hexadecimal => HexadecimalConverter.ToDecimalism(scaleStr), _ => StringIntDeterminer.To(scaleStr) });
public static int?StringToNullableInt32(string str) { if (StringIntDeterminer.Is(str)) { return(StringIntDeterminer.To(str)); } return(null); }
public static int StringToInt32(string str, params IConversionImpl <string, int>[] impls) { return(StringIntDeterminer.To(str, impls)); }
public static int StringToInt32(string str, int defaultVal = default) { return(StringIntDeterminer.To(str, defaultVal)); }