private string GetDataFromLookUpOrUser(string tempString)
{
string temp = "";
string temp2 = "";
string temp3 = "";
string temp4 = "";
int count = 0;
Boolean start = true;
for (int i = 0; i < tempString.Length; i++)
{
temp += tempString.Substring(i, 1);
if (i < tempString.Length - 1)
{
if (tempString.Substring(i, 2) == "#^")
{
if (start == true)
{
temp2 = temp.Substring(0, temp.Length - 1);
temp = "";
i++;
start = false;
}
}
else if (tempString.Substring(i, 2) == "^#")
{
temp3 += temp.Substring(1, temp.Length - 2);
temp = "";
i++;
start = true;
count = 0;
temp4 += temp2 + temp3;
temp3 = "";
}
else if (tempString.Substring(i, 2) == ";#" && start == false)
{
count++;
if (count % 2 == 0)
{
temp3 += temp.Substring(1, temp.Length - 2);
temp3 = temp3 + ",";
temp = "";
i++;
}
else
{
temp = "";
}
}
}
}
return temp4 + temp;
}
private string GetDataFromCalculatedField(string tempString)
{
string temp = "";
string temp2 = "";
string temp3 = "";
string temp4 = "";
int count = 0;
Boolean start = true;
for (int i = 0; i < tempString.Length; i++)
{
temp += tempString.Substring(i, 1);
if (i < tempString.Length - 1)
{
if (tempString.Substring(i, 2) == "#%")
{
if (start == true)
{
temp2 = temp.Substring(0, temp.Length - 1);
temp = "";
i++;
start = false;
}
}
else if (tempString.Substring(i, 2) == "%#")
{
temp3 += temp.Substring(1, temp.Length - 2);
temp = "";
i++;
start = true;
count = 0;
temp4 += temp2 + temp3;
temp3 = "";
}
else if (tempString.Substring(i, 2) == ";#" && start == false)
{
count++;
if (count % 2 == 0)
{
temp3 += temp.Substring(1, temp.Length - 2);
temp3 = temp3 + ",";
temp = "";
i++;
}
else
{
temp = "";
}
}
}
}
return temp4 + temp;
}
private string GetDataFromMultipleChoice(string tempString)
{
string temp = "";
string temp2 = "";
string temp3 = "";
string temp4 = "";
Boolean start = true;
for (int i = 0; i < tempString.Length; i++)
{
temp += tempString.Substring(i, 1);
if (i < tempString.Length - 3)
{
if (tempString.Substring(i, 4) == "#*MC")
{
if (start == true)
{
temp2 = temp.Substring(0, temp.Length - 1);
temp = "";
i += 3;
start = false;
}
}
else if (tempString.Substring(i, 4) == "MC*#")
{
temp = "";
i += 3;
start = true;
temp4 += temp2 + temp3.Substring(0, temp3.Length - 1);
}
else if (tempString.Substring(i, 2) == ";#")
{
temp3 += temp.Substring(0, temp.Length - 1);
temp3 = temp3 + ",";
temp = "";
i++;
}
}
}
return temp4 + temp;
}
/// <summary>
/// 取得 HyperLink 类型的值
/// </summary>
/// <param name="strValue"></param>
/// <returns></returns>
private string GetDataFromHyperLink(string strValue)
{
if (strValue == "")
{
return "";
}
if (strValue.IndexOf(",") > 0)
{
return strValue.Substring(0, strValue.IndexOf(","));
}
else
{
return strValue;
}
}

本文介绍了一种从带有特定标记的字符串中提取数据的方法,包括查找特定字符序列以分割和处理字符串,适用于多种字段类型如查找引用或用户输入、计算字段、多选字段和超链接字段。
1258

被折叠的 条评论
为什么被折叠?



