mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 07:01:04 +00:00
29 lines
642 B
C#
29 lines
642 B
C#
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace WelsonJS.Serialization
|
|
{
|
|
public class KVSerializer
|
|
{
|
|
private static Dictionary<string, string> dict = new Dictionary<string, string>();
|
|
|
|
public void Add(string key, string value)
|
|
{
|
|
dict[key] = value;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
foreach (var x in dict)
|
|
{
|
|
sb.Append($"{x.Key}={x.Value}; ");
|
|
}
|
|
if (sb.Length > 0) sb.Length -= 2;
|
|
|
|
return sb.ToString();
|
|
}
|
|
}
|
|
}
|