Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
C# - string parsing
//Title of this code //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; namespace Rextester { public class Program { public static void Main(string[] args) { String myString = "PO:49, Due:Aug 12, 2015, Amt:600.00"; String[] myDelimiters = new String[] { ", Due:", ", Amt:" }; //String myDate = myString.split(new char[] {', Due:',', Amt:'}); //String myDate = myString.split(myDelimiters); //String myDate = myString.split(","); Console.WriteLine("FULL:" + myString); //Console.WriteLine("DATE:" + myDate); //string source = "[stop]ONE[stop][stop]TWO[stop][stop][stop]THREE[stop][stop]"; //string[] stringSeparators = new string[] {"[stop]"}; string[] result; result = myString.Split(myDelimiters, StringSplitOptions.None); foreach (string s in result) { Console.Write("'{0}' ", String.IsNullOrEmpty(s) ? "<>" : s); } Console.WriteLine(""); Console.WriteLine("DATE:" + result[1]); string s = "This is a sentence."; string[] res = s.Split(new string[]{ " is " }, StringSplitOptions.None); for(int i=0; i<res.length; i++) Console.Write(res[i]); } } }
run
|
edit
|
history
|
help
0
GetChange
Ex03 cm=ft,in
eg
Https://www.t.me/Govnoposti
lala
Generic Interface basic
d
CallBy Val Vs Ref Double
a
https://www.facebook.com/gluncev