/// <summary>
 /// To nullable TimeSpan
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public static DateTimeSpan?CastToNullableDateTimeSpan(this string str)
 {
     if (StringDateTimeSpanDeterminer.Is(str))
     {
         return(CastToDateTimeSpan(str));
     }
     return(null);
 }
Example #2
0
 /// <summary>
 /// Convert the given string to a nullable <see cref="DateTimeSpan"/>. <br />
 /// 将给定的字符串转换为可空的 <see cref="DateTimeSpan"/>。
 /// </summary>
 /// <param name="str"></param>
 /// <returns></returns>
 public static DateTimeSpan?CastToNullableDateTimeSpan(this string str)
 {
     return(StringDateTimeSpanDeterminer.Is(str)
         ? CastToDateTimeSpan(str)
         : (DateTimeSpan?)null);
 }