Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
扩展方法可以用于 DataColumn.Expression 以支持例如替换功能吗?
如果是,是否有任何可用的示例代码?
谢谢。
可能不是你想的那样做。
如果您不关心要替换的原始字符串源,则可以迭代每个 DataRow 并更新每个项目的列值。
foreach(var row in yourDataTable.Rows) { row["colName"] = row["colName"].ToString().Replace("abc", "xyz"); }