mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-09 03:34:02 +08:00
Update 0151.翻转字符串里的单词,添加C# LINQ版
This commit is contained in:
@ -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"/>
|
||||
|
Reference in New Issue
Block a user