Here's my code:
#region//Main() Put everything thats finished in here to output it to Console Apllication.
static void Main(string args)
static void FirstPart() // don't know what else to call this.
//Console.WriteLine(numS());// commented out
string pi = Console.ReadLine();
PItoArray = pi.ToCharArray(pi.Min(),pi.Max());
#region //numS() gets number of char in player input.
//static int numS()
// int num = PlayerInput().Length;
// return num;
#region//PlayerInput() Gets whatever player writes in console apllication
static string PlayerInput()
string S = Console.ReadLine();
static char PItoArray;
If you want the string converted to a char array of exactly the same size, you can just call
pi.ToCharArray() without any argument, and it will automatically create a char array containing the exact same number of chars in the original string.
Also please note that what calling
pi.Max() will give you back is the char with the highest char code according to the ASCII table, not the string size, as it appears you are assuming. (
"Hello, world".Max() returns the char
'r' which has the code 114 - the highest char code inside the string).