Пример #1
0
 /// <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)
     });
Пример #2
0
 public static int?StringToNullableInt32(string str)
 {
     if (StringIntDeterminer.Is(str))
     {
         return(StringIntDeterminer.To(str));
     }
     return(null);
 }
Пример #3
0
 public static int StringToInt32(string str, params IConversionImpl <string, int>[] impls)
 {
     return(StringIntDeterminer.To(str, impls));
 }
Пример #4
0
 public static int StringToInt32(string str, int defaultVal = default)
 {
     return(StringIntDeterminer.To(str, defaultVal));
 }