Ja sam to do sada radio na ovaj nacin:
Code:
string prezimeime = comboBox1.Text;
string prezime = "";
string ime = "";
bool status = false;
for (int i = 0; i < comboBox1.Text.Length; i++ )
{
if (prezimeime[i] != ' ' && status == false)
{
prezime += prezimeime[i].ToString();
}
else
{
status = true;
if (prezimeime[i] != ' ')
ime += prezimeime[i].ToString();
}
}
string prezimeime = comboBox1.Text;
string prezime = "";
string ime = "";
bool status = false;
for (int i = 0; i < comboBox1.Text.Length; i++ )
{
if (prezimeime[i] != ' ' && status == false)
{
prezime += prezimeime[i].ToString();
}
else
{
status = true;
if (prezimeime[i] != ' ')
ime += prezimeime[i].ToString();
}
}