Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use DataTable.Select to escape special characters

Shulou Source: shulou.com Published: 2022-06-03 07:38:24 11月15日 Update

This article mainly introduces "how to use DataTable.Select to achieve the escape of special characters". In daily operation, I believe many people have doubts about how to use DataTable.Select to achieve the escape of special characters. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "how to use DataTable.Select to achieve the escape of special characters". Next, please follow the editor to study!

The copy code is as follows:

Public static string Replace (string oldStr)

{

If (string.IsNullOrEmpty (oldStr))

{

Return ""

}

String str2 = Regex.Replace (oldStr, @ "[\ [\ +\ |\ (\)\ ^\ *\"\]'% ~ #-&]", delegate (Match match)

{

If (match.Value = "'")

{

Return "'"

}

Else

{

Return "[" + match.Value + "]"

}

});

Return str2

}

At this point, the study on "how to use DataTable.Select to achieve the escape of special characters" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Special character escape learning code more help practical next articles methods theory knowledge articles websites materials follow questions easy to use practice Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Xiaomi MariaDB Linux Apple