You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
824 B
31 lines
824 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace Apewer.Internals
|
|
{
|
|
|
|
internal static class TextHelper
|
|
{
|
|
|
|
public static StringPairs ParseConnectionString(string connectionString)
|
|
{
|
|
var sp = new StringPairs();
|
|
if (string.IsNullOrEmpty(connectionString)) return sp;
|
|
|
|
var split = connectionString.Split(";");
|
|
foreach (var item in split)
|
|
{
|
|
var equal = item.IndexOf("=");
|
|
if (equal < 0) continue;
|
|
var left = item.Substring(0, equal).ToTrim();
|
|
var right = item.Substring(equal + 1).ToTrim();
|
|
if (left.IsEmpty() || right.IsEmpty()) continue;
|
|
sp.Add(left, right);
|
|
}
|
|
return sp;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|