mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-15 22:29:28 +00:00
28 lines
609 B
C#
28 lines
609 B
C#
using System.Text;
|
|
|
|
namespace System.Extensions
|
|
{
|
|
public static class StringExtensions
|
|
{
|
|
public static bool IsNullOrEmpty(this string s)
|
|
{
|
|
return string.IsNullOrEmpty(s);
|
|
}
|
|
|
|
public static bool IsNullOrWhiteSpace(this string s)
|
|
{
|
|
return string.IsNullOrWhiteSpace(s);
|
|
}
|
|
|
|
public static byte[] GetBytes(this string s)
|
|
{
|
|
return Encoding.UTF8.GetBytes(s);
|
|
}
|
|
|
|
public static string GetString(this byte[] bytes)
|
|
{
|
|
return Encoding.UTF8.GetString(bytes);
|
|
}
|
|
}
|
|
}
|