Update 0151.翻转字符串里的单词,添加C# LINQ版

This commit is contained in:
eeee0717
2023-11-07 09:20:04 +08:00
parent 451c045a6e
commit 4500cbd9bd

View File

@ -972,6 +972,13 @@ char * reverseWords(char * s){
}
```
### C#
```C# LINQ高级方法
public string ReverseWords(string s) {
return string.Join(' ', s.Trim().Split(' ',StringSplitOptions.RemoveEmptyEntries).Reverse());
}
```
<p align="center">
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>