Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
SSTR PARS
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; using System.IO; using System.Text; namespace Rextester { public class Program { public static void Main(string[] args) { string s="SOC:50% DTE:62Km ODO:12Km Speed:000Kmph Mode:DE 0,FM 0,LHM 0,NM 1,RM 1,SM 0,"; //string s = "there is a cat"; // Split string on spaces. // ... This will separate all the words. string[] words = s.Split(' '); int check=0; StringBuilder builder=new StringBuilder(); List<string> rawDat=new List<string>(); foreach (string word in words) { if(word.Contains("Mode")) { builder.Append(word); check=1; } else if(check==1) { builder.Append(" "+word); } else { rawDat.Add(word); } } rawDat.Add(builder.ToString()); foreach(string val in rawDat) { Console.WriteLine(val); } } } }
run
|
edit
|
history
|
help
0
Find X numbers of 6 in row (dices)
codeWall
ss
Test
Pizzas&Tuples&Golden-Medal
to get distinct of the given array with each items occurrence count._1
arrays bidimencionales y tridimencionales
2
jjj4
Quarter Hour String Generator