当前位置:网站首页>String usage in C #

String usage in C #

2022-07-08 01:01:00 Poetry and distance

1.string.join

In the specified String The specified separator is concatenated between each element of the array String, This produces a single concatenated string . for example :

string [] array={
    abc,def,ghi};
string a = string.Join("-", array);

here a=“abc-def-ghi”;

2.string.IsNullOrWhiteSpace

Judge all blank characters , Function equivalent to string.IsNullOrEmpty and str.Trim().Length The sum of the , He gave the string to Char.IsWhiteSpace by ture Any character of will be correct . according to MSDN Explanation , This method will be more efficient and concise than calling the above two methods , So when judging this function , Recommended .

原网站

版权声明
本文为[Poetry and distance]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/189/202207072311464241.html