Advertisement
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 ConsoleApp3
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] array = Methode("Hallo Welt und Rest der Nation");
- string a = array[0];
- string b = array[1];
- Console.WriteLine(a);
- Console.WriteLine(b);
- Console.ReadKey();
- }
- static string[] Methode(string v)
- {
- string a = "";
- string b = "";
- char c = ' ';
- bool vorBlank = true;
- for (int i = 0; i < v.Length; i++)
- {
- c = v[i];
- if (c == ' ' && vorBlank)
- {
- vorBlank = false;
- }
- else
- {
- if (vorBlank)
- {
- a += c;
- }
- if (!vorBlank)
- {
- b += c;
- }
- }
- }
- return new string[] { a, b };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement