Esempio n. 1
0
        /// <summary>
        /// 转化为默认的时间格式yyyy-MM-dd HH:mm:ss
        /// </summary>
        /// <returns></returns>
        public string ToTimeStrDefault()
        {
            if (this.data == null)
            {
                return(string.Empty);
            }

            return(SafeConvert.ToDateTime(this.data).ToString("yyyy-MM-dd HH:mm:ss"));
        }
Esempio n. 2
0
 /// <summary>
 /// 移除前缀,若前缀不存在则返回原字符串
 /// </summary>
 public string DeletePrefix(string prefix)
 {
     return(SafeConvert.DeletePrefix(this.data, prefix));
 }
Esempio n. 3
0
 /// <summary>
 /// 增加后缀,若已经以指定后缀结尾则不添加
 /// </summary>
 public string AppendSuffix(string suffix)
 {
     return(SafeConvert.AppendSuffix(this.data, suffix));
 }
Esempio n. 4
0
 /// <summary>
 /// XML解码
 /// </summary>
 public string DecodeXML()
 {
     return(SafeConvert.DecodeXML(this.data));
 }
Esempio n. 5
0
 /// <summary>
 /// 转化为指定类型
 /// </summary>
 public T To <T>() where T : class
 {
     return(SafeConvert.To <T>(this.data));
 }
Esempio n. 6
0
 /// <summary>
 /// 转化为日期时间值
 /// </summary>
 public DateTime ToDateTime(DateTime defaultValue = default(DateTime))
 {
     return(SafeConvert.ToDateTime(this.data, defaultValue));
 }
Esempio n. 7
0
 /// <summary>
 /// 转化为整型值
 /// </summary>
 public int ToInt32(int defaultValue = default(int))
 {
     return(SafeConvert.ToInt32(this.data, defaultValue));
 }
Esempio n. 8
0
 /// <summary>
 /// 转化为字符串值
 /// </summary>
 public string ToStr(string defaultValue = "")
 {
     return(SafeConvert.ToStr(this.data, defaultValue).Trim());
 }
Esempio n. 9
0
 /// <summary>
 /// 字符串转化为字符串数组
 /// </summary>
 public string[] SplitToArray(string speater = ",", StringSplitOptions options = StringSplitOptions.None)
 {
     return(SafeConvert.SplitToArray(this.data, speater, options));
 }
Esempio n. 10
0
 /// <summary>
 /// MD5编码
 /// </summary>
 public string EncodeMD5(bool replace = true)
 {
     return(SafeConvert.EncodeMD5(this.data, replace));
 }
Esempio n. 11
0
 /// <summary>
 /// 64位解码
 /// </summary>
 public string DecodeBase64String()
 {
     return(SafeConvert.DecodeBase64String(this.data, Encoding.Default));
 }
Esempio n. 12
0
 /// <summary>
 /// 64位解码
 /// </summary>
 public string DecodeBase64String(System.Text.Encoding e)
 {
     return(SafeConvert.DecodeBase64String(this.data, e));
 }
Esempio n. 13
0
 /// <summary>
 /// URI解码
 /// </summary>
 public string DecodeUri()
 {
     return(SafeConvert.DecodeUri(this.data, Encoding.Default));
 }
Esempio n. 14
0
 /// <summary>
 /// URI解码
 /// </summary>
 public string DecodeUri(Encoding e)
 {
     return(SafeConvert.DecodeUri(this.data, e));
 }
Esempio n. 15
0
 /// <summary>
 /// 移除后缀,若后缀不存在则返回原字符串
 /// </summary>
 public string DeleteSuffix(string suffix)
 {
     return(SafeConvert.DeleteSuffix(this.data, suffix));
 }
Esempio n. 16
0
 /// <summary>
 /// SQL编码
 /// </summary>
 public string EncodeSql(bool isLike = false)
 {
     return(SafeConvert.EncodeSql(this.data, isLike));
 }
Esempio n. 17
0
 /// <summary>
 /// 字符串转化为字符串集合
 /// </summary>
 public List <string> SplitToList(string speater = ",", StringSplitOptions options = StringSplitOptions.None)
 {
     return(SafeConvert.SplitToList(this.data, speater, options));
 }
Esempio n. 18
0
 /// <summary>
 /// 字符串转化为字典
 /// </summary>
 public Dictionary <string, string> SplitToDict(string speater1 = ";", string speater2 = ",")
 {
     return(SafeConvert.SplitToDict(this.data, speater1, speater2));
 }
Esempio n. 19
0
 /// <summary>
 /// 返回最后一个分隔符之后的内容
 /// </summary>
 public string GetLastAfter(string speater)
 {
     return(SafeConvert.GetLastAfter(this.data, speater));
 }
Esempio n. 20
0
 /// <summary>
 /// 转化为浮点值
 /// </summary>
 public decimal ToDecimal(decimal defaultValue = default(decimal))
 {
     return(SafeConvert.ToDecimal(this.data, defaultValue));
 }
Esempio n. 21
0
 /// <summary>
 /// 返回最后一个分隔符之前的内容
 /// </summary>
 public string GetLastBefore(string speater)
 {
     return(SafeConvert.GetLastBefore(this.data, speater));
 }
Esempio n. 22
0
 /// <summary>
 /// 转化为布尔值
 /// </summary>
 public bool ToBool(bool defaultValue = default(bool))
 {
     return(SafeConvert.ToBool(this.data, defaultValue));
 }
Esempio n. 23
0
 /// <summary>
 /// 增加前缀,若已经以指定前缀开始则不添加
 /// </summary>
 public string AppendPrefix(string prefix)
 {
     return(SafeConvert.AppendPrefix(this.data, prefix));
 }
Esempio n. 24
0
 /// <summary>
 /// 转化为字典
 /// </summary>
 public Dictionary <string, object> ToAnonymousDict()
 {
     return(SafeConvert.ToAnonymousDict(this.data));
 }
Esempio n. 25
0
 /// <summary>
 /// JSON编码
 /// </summary>
 public string EncodeJson()
 {
     return(SafeConvert.EncodeJson(this.data));
 }