CSharp examples for System:String Join
Join Verbatim String
using System.Text.RegularExpressions; using System.Linq; using System;/* www . j av a2s . c o m*/ public class Main{ public static string JoinVerbatim(this string s) { return string.Join("", s.Split(new[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries) .Select(x => x.TrimVerbatim())); } public static string TrimVerbatim(this string s) { var r = new Regex(@"^\s+", RegexOptions.Multiline); return r.Replace(s, string.Empty); } }