예제 #1
0
 /// <summary>
 /// Cast <see cref="object"/> to <see cref="string"/>.
 /// </summary>
 /// <param name="obj"></param>
 /// <returns></returns>
 public static string CastToString(this object obj) => StringConv.ObjectSafeToString(obj);
예제 #2
0
 /// <summary>
 /// Convert <see cref="object"/> to <see cref="string"/> safety.
 /// </summary>
 /// <param name="obj"></param>
 /// <param name="defaultVal"></param>
 /// <returns></returns>
 public static string ToString(object obj, string defaultVal = default) => StringConv.ObjectSafeToString(obj, defaultVal);