From d164c86ac418de56e18ab6edb7578e896d5cb892 Mon Sep 17 00:00:00 2001 From: zhangjiong Date: Mon, 17 Jan 2022 01:23:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=200344.=E5=8F=8D=E8=BD=AC?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E4=B8=B2=20C#=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- problems/0344.反转字符串.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/problems/0344.反转字符串.md b/problems/0344.反转字符串.md index 9176c915..920cd86c 100644 --- a/problems/0344.反转字符串.md +++ b/problems/0344.反转字符串.md @@ -232,6 +232,19 @@ void reverseString(char* s, int sSize){ } ``` +C#: +```csharp +public class Solution +{ + public void ReverseString(char[] s) + { + for (int i = 0, j = s.Length - 1; i < j; i++, j--) + { + (s[i], s[j]) = (s[j], s[i]); + } + } +} +``` -----------------------