static private String UnescapeNlsString(String str, int start, int end)
{
Contract.Requires(str != null);
Contract.Requires(start >= 0);
Contract.Requires(end >= 0);
StringBuilder result = null;
for (int i = start; i < str.Length && i <= end; i++)
{
switch (str[i])
{
case '\'':
if (result == null)
{
result = new StringBuilder(str, start, i - start, str.Length);
}
break;
case '\\':
if (result == null)
{
result = new StringBuilder(str, start, i - start, str.Length);
}
++i;
if (i < str.Length)
{
result.Append(str[i]);
}
break;
default:
if (result != null)
{
result.Append(str[i]);
}
break;
}
}
if (result == null)
return (str.Substring(start, end - start + 1));
return (result.ToString());
}