Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //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)
- {
- //Your code goes here
- string command = @"edit 0:\File with multiple word filename.txt 10 Hello world";
- string path="";
- string line ="";
- string text = "";
- bool dot = false;
- Console.Write(">");
- command=Console.ReadLine();
- string[] array = command.Split(' ');
- int index = 0;
- for(int i=1;i<array.Length;i++)
- {
- if(array[i].Contains('.')==true)
- {
- path+=array[i]+' ';
- dot=true;
- index = i+1;
- break;
- }
- else
- {
- path+=array[i]+' ';
- }
- }
- line = array[index];
- index++;
- for(int i=index;i<array.Length;i++)
- {
- text+= array[i]+ ' ';
- }
- Console.WriteLine("FILE NAME: " + path);
- Console.WriteLine("LINE TO EDIT: " + line);
- Console.WriteLine("TEXT: " + text);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement