C# 字符串数组合并:使用 = 号连接字符串
在 C# 中,可以使用 string.Join 方法将字符串数组合并起来。该方法接受两个参数:分隔符和要合并的字符串数组。以下是一个示例:
string[] arr = {'hello', 'world', '!'};
string result = string.Join(" ", arr);
Console.WriteLine(result);
输出结果为:hello world !
在上面的示例中,我们使用空格作为分隔符,将字符串数组合并成一个字符串。
原文地址: https://www.cveoy.top/t/topic/oElI 著作权归作者所有。请勿转载和采集!