diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-10 06:03:25 +0100 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2018-03-10 06:03:25 +0100 |
| commit | 407690e9b8a2693a7bd831e954c079cb26c569b7 (patch) | |
| tree | 080e33bbd9e9aea75048306513cde40b603223ea /src/ExtensionsMethods.cs | |
| parent | fd3397cdf340284c7cbb912b45ebfdbb654947d5 (diff) | |
getStremFromPath made instanced for overriding in designiface, crowide wip
Diffstat (limited to 'src/ExtensionsMethods.cs')
| -rw-r--r-- | src/ExtensionsMethods.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ExtensionsMethods.cs b/src/ExtensionsMethods.cs index d7448874..cb662c51 100644 --- a/src/ExtensionsMethods.cs +++ b/src/ExtensionsMethods.cs @@ -144,7 +144,12 @@ namespace Crow handler(sender, e); } } - + public static byte[] GetBytes(this string str) + { + byte[] bytes = new byte[str.Length * sizeof(char)]; + System.Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length); + return bytes; + } public static bool IsWhiteSpaceOrNewLine (this char c) { return c == '\t' || c == '\r' || c == '\n' || char.IsWhiteSpace (c); |