I am making a project, But i need to be able to split 1 row of text into 2 strings. How would i go about doing this?
using System;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
Console.Title = "Stinger";
Console.Write("Configuration FIle.... ");
Thread.Sleep(1000);
if (System.IO.File.Exists(@"C:\Stinger\Configuration\config.cfg"))
{
Console.Write("Found");
Thread.Sleep(1000);
Console.WriteLine("\r\n");
Console.WriteLine("--Configuration--");
string[] readText = File.ReadAllLines(@"C:\Stinger\Configuration\config.cfg");
foreach (string s in readText)
{
Console.WriteLine(s);
Thread.Sleep(1000);
}
}
else // Configuration File Else Statement
{
Console.WriteLine("Missing");
Thread.Sleep(4000);
}
}
}
And here is my Config Contents
fullscreen 1
I want to be able to make "fullscreen" and "1" part of the row 2 strings. I've done continuous googling and reading articles on how to split. But it's not making any sense to me. Any help?