Piscal client - check status and retrieve file skeleton in place
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
@@ -16,6 +15,11 @@ namespace LeafWeb.Core.Utility
|
||||
current + (char.IsUpper(c) && current.Length > 0 ? " " + c : c.ToString(CultureInfo.InvariantCulture)));
|
||||
}
|
||||
|
||||
public static string[] SplitNewLine(this string str)
|
||||
{
|
||||
return str.Split(new[] {"\n", "\r\n"}, StringSplitOptions.None);
|
||||
}
|
||||
|
||||
public static string LowercaseFirst(string s)
|
||||
{
|
||||
// Check for empty string.
|
||||
@@ -29,23 +33,12 @@ namespace LeafWeb.Core.Utility
|
||||
|
||||
public static byte[] GetBytes(this string str)
|
||||
{
|
||||
var bytes = new byte[str.Length * sizeof(char)];
|
||||
Buffer.BlockCopy(str.ToCharArray(), 0, bytes, 0, bytes.Length);
|
||||
return bytes;
|
||||
return System.Text.Encoding.Default.GetBytes(str);
|
||||
}
|
||||
|
||||
public static string GetString(this byte[] bytes)
|
||||
{
|
||||
var chars = new char[bytes.Length / sizeof(char)];
|
||||
Buffer.BlockCopy(bytes, 0, chars, 0, bytes.Length);
|
||||
return new string(chars);
|
||||
}
|
||||
|
||||
public static Dictionary<string, string> SplitConnectionString(this string connectionString)
|
||||
{
|
||||
return connectionString.Split(';')
|
||||
.Select(t => t.Split(new[] { '=' }, 2))
|
||||
.ToDictionary(t => t[0].Trim(), t => t[1].Trim(), StringComparer.InvariantCultureIgnoreCase);
|
||||
return System.Text.Encoding.Default.GetString(bytes);
|
||||
}
|
||||
|
||||
public static string FilterAlphaNumeric(this string input)
|
||||
|
||||
Reference in New Issue
Block a user