I don't understand the use of "split" in C#
Posted: 08 Dec 2013, 20:27
I'm making a command that renames the server and this is my attempt:
Clearly I'm doing something wrong with it at Server.name = split[0];
I want it to work like /server name (message)
I plan to add more controls, that's why.
- Code: Select all
if (message == "")
{
Help(p);
return;
}
string[] split = message.Trim().Split(' ');
if (message == "name")
{
Server.name = split[0];
}
Clearly I'm doing something wrong with it at Server.name = split[0];
I want it to work like /server name (message)
I plan to add more controls, that's why.