当前位置:网站首页>C#中string用法
C#中string用法
2022-07-07 23:12:00 【有诗亦有远方】
string.Join
1.string.join
在指定 String 数组的每个元素之间串联指定的分隔符 String,从而产生单个串联的字符串。例如:
string [] array={
abc,def,ghi};
string a = string.Join("-", array);
此时a=“abc-def-ghi”;
2.string.IsNullOrWhiteSpace
判断所有空白字符,功能相当于string.IsNullOrEmpty和str.Trim().Length总和,他将字符串给Char.IsWhiteSpace为ture的任何字符都将是正确的。根据MSDN的说明,这个方法会比调用上述两个方法的性能更高而且简洁,所以在判断这个功能时,推荐使用。
边栏推荐
- Semantic segmentation model base segmentation_ models_ Detailed introduction to pytorch
- [reprint] solve the problem that CONDA installs pytorch too slowly
- Jouer sonar
- 3 years of experience, can't you get 20K for the interview and test post? Such a hole?
- They gathered at the 2022 ecug con just for "China's technological power"
- 牛客基础语法必刷100题之基本类型
- Handwriting a simulated reentrantlock
- 《因果性Causality》教程,哥本哈根大学Jonas Peters讲授
- Cascade-LSTM: A Tree-Structured Neural Classifier for Detecting Misinformation Cascades(KDD20)
- v-for遍历元素样式失效
猜你喜欢
华为交换机S5735S-L24T4S-QA2无法telnet远程访问
NVIDIA Jetson test installation yolox process record
Fofa attack and defense challenge record
AI zhetianchuan ml novice decision tree
第四期SFO销毁,Starfish OS如何对SFO价值赋能?
Invalid V-for traversal element style
1293_ Implementation analysis of xtask resumeall() interface in FreeRTOS
Jemter distributed
Cancel the down arrow of the default style of select and set the default word of select
NVIDIA Jetson测试安装yolox过程记录
随机推荐
51 communicates with the Bluetooth module, and 51 drives the Bluetooth app to light up
【GO记录】从零开始GO语言——用GO语言做一个示波器(一)GO语言基础
Analysis of 8 classic C language pointer written test questions
AI遮天传 ML-初识决策树
手机上炒股安全么?
Invalid V-for traversal element style
QT establish signal slots between different classes and transfer parameters
v-for遍历元素样式失效
国外众测之密码找回漏洞
[reprint] solve the problem that CONDA installs pytorch too slowly
Deep dive kotlin synergy (XXII): flow treatment
Fofa attack and defense challenge record
Reentrantlock fair lock source code Chapter 0
Su embedded training - Day3
SDNU_ ACM_ ICPC_ 2022_ Summer_ Practice(1~2)
AI zhetianchuan ml novice decision tree
Leetcode brush questions
什么是负载均衡?DNS如何实现负载均衡?
SDNU_ACM_ICPC_2022_Summer_Practice(1~2)
Image data preprocessing