我有一個字符串,其中的表名每次更改。如何找到字符串,並使用其value.eg如何獲取未知長度的子字符串
樣品字符串:
表 'ProductCostHistory'。計數1,邏輯5,物理0
if (line.Contains("Count"))
{
int index = line.IndexOf("Count");
string substring2 = line.Substring(index, 12);
string scancountval = substring2.Substring(11);
}
現在我該怎麼辦了表ProductCostHistory
,其中表的名稱更改每次都一樣嗎?
請再問一次 – 2014-09-25 09:47:28
您可以在您的問題中添加一些示例字符串嗎? – Shaharyar 2014-09-25 09:47:36
這將有助於看到字符串值可能的一些示例,同樣重要的是,您希望從中獲得什麼。我懷疑你會找'string.Split',但是根據你現在給我們展示的內容是不可能的。 – 2014-09-25 09:49:00