[Solved] How can i extract the info between ” ” ? C#

[ad_1] Try this demo, put it in a Main method of a console application (it uses Regex so you have to add line “using System.Text.RegularExpressions;”): string input = “AT+CMGL=\”ALL\”\n+CMGL: 0,\”REC READ\”,\”+40728072005\”,,\”12/06/29,13:04:26+12\”\npassword,1,ON”; var matches = Regex.Matches( input, @”\””(?<msisdn>\+\d*)\””,.*,\””(?<date>\d{2}\/\d{2}/\d{2},\d{2}:\d{2}:\d{2}\+\d{2})\””.*\n+(?<passwd>[^,]*),(?<itemno>\d*),(?<command>\w*)” , RegexOptions.Multiline); foreach (Match m in matches) { Console.WriteLine(m.Groups[“msisdn”].Value); Console.WriteLine(m.Groups[“date”].Value); Console.WriteLine(m.Groups[“passwd”].Value); Console.WriteLine(m.Groups[“itemno”].Value); Console.WriteLine(m.Groups[“command”].Value); } Console.ReadKey(); Basically, regular expression … Read more

[Solved] returning a buffer in c [closed]

[ad_1] Is it even possible for “main” to return a buffer? No and you shouldn’t. What should main() return in C and C++? How should I create, append string and return it? char aString[FIXED_SIZE]; memset(aString, 0, sizeof aString); strcpy(aString, “This is a string”); [ad_2] solved returning a buffer in c [closed]