mirror of
https://github.com/AlexMacocian/SystemExtensions.git
synced 2026-07-16 06:29:29 +00:00
9a7125fbb0
Added coding style helpers. Unit tests.
18 lines
357 B
C#
18 lines
357 B
C#
using System.Text;
|
|
|
|
namespace System.Extensions
|
|
{
|
|
public static class StringExtensions
|
|
{
|
|
public static byte[] GetBytes(this string s)
|
|
{
|
|
return Encoding.UTF8.GetBytes(s);
|
|
}
|
|
|
|
public static string GetString(this byte[] bytes)
|
|
{
|
|
return Encoding.UTF8.GetString(bytes);
|
|
}
|
|
}
|
|
}
|