Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication10
- {
- class Program
- {
- static void Main(string[] args)
- {
- string s = "One 2; 3 4; 5 ";
- Converter c = new Converter();
- String[] num = c.split(s);
- foreach(var r in num)
- {
- Console.WriteLine(r);
- }
- Console.ReadLine();
- }
- }
- class Converter
- {
- string[] numbers;
- string[] separator = { ";" };
- public String[] split(string s)
- {
- numbers = s.Split(separator, StringSplitOptions.RemoveEmptyEntries);
- return numbers;
- }
- public
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment