Untitled

mail@pastecode.io avatar
unknown
plain_text
4 months ago
473 B
2
Indexable
public static class StringExtensions
{
    public static bool IsNullOrEmpty(this string value) => string.IsNullOrEmpty(value);

    public static string ReplactAt(this string str, int index, int length, string replace)
    {
        return str.Remove(index, length).Insert(index, replace);
    }

    public static string NullToEmpty(this object value)
    {
        if(value == null) return string.Empty;
        return value.ToString().Trim();
    }
    
}
Leave a Comment