Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement