using System;
class Pruebaout
{
static void Partir(string nombreCompleto, out string nombre, out string apellido)
{
int i = nombreCompleto.LastIndexOf(' ');
nombre = nombreCompleto.Substring(0, i);
apellido = nombreCompleto.Substring(i + 1);
}
static void Main()
{
string a, b;
Partir("Juan Ortiz", out a, out b);
Console.WriteLine(a); // Juan
Console.WriteLine(b); // Ortiz
}
}
dXNpbmcgU3lzdGVtOwoKY2xhc3MgUHJ1ZWJhb3V0CnsKICAgIHN0YXRpYyB2b2lkIFBhcnRpcihzdHJpbmcgbm9tYnJlQ29tcGxldG8sIG91dCBzdHJpbmcgbm9tYnJlLCBvdXQgc3RyaW5nIGFwZWxsaWRvKQogICAgewogICAgICAgIGludCBpID0gbm9tYnJlQ29tcGxldG8uTGFzdEluZGV4T2YoJyAnKTsKICAgICAgICBub21icmUgPSBub21icmVDb21wbGV0by5TdWJzdHJpbmcoMCwgaSk7CiAgICAgICAgYXBlbGxpZG8gPSBub21icmVDb21wbGV0by5TdWJzdHJpbmcoaSArIDEpOwogICAgfQoKICAgIHN0YXRpYyB2b2lkIE1haW4oKQogICAgewogICAgICAgIHN0cmluZyBhLCBiOwogICAgICAgIFBhcnRpcigiSnVhbiBPcnRpeiIsIG91dCBhLCBvdXQgYik7CiAgICAgICAgQ29uc29sZS5Xcml0ZUxpbmUoYSk7ICAgICAgICAgICAgICAgLy8gSnVhbgogICAgICAgIENvbnNvbGUuV3JpdGVMaW5lKGIpOyAgICAgICAgICAgICAgIC8vIE9ydGl6CiAgICB9Cn0=