can i split
"a(1),b(2),c(3)" to "1,2,3"
in c# without using forloop?
can i split
"a(1),b(2),c(3)" to "1,2,3"
in c# without using forloop?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Jun 13, 2012, 12:33 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jun 12, 2012, 4:38 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jun 12, 2012, 5:10 AM EDT
using System.Text.RegularExpressions;
// ...
string text = "abc(10),def_123(11),GHI456(12)";
brunda kRank #3,804 · 389 reputationPosted Jun 12, 2012, 8:37 AM EDT
StringBuilder str = new StringBuilder();
str.Append(text.Substring(2, 1) + text.Substring(4, 1) + text.Substring(7, 1) + text.Substring(9, 1) + text.Substring(12, 1));
satya5 reputationPosted Jun 12, 2012, 7:31 PM EDT
"res 765(1), b'ees 54(2), can:e 43(3)"
to split into "1,2,3"
satya5 reputationPosted Jun 13, 2012, 3:38 AM EDT