fork download
  1. using static System.Console;
  2.  
  3. public class Program {
  4. public static void Main() {
  5. var texto = "ZACKSON MOREIRA MORGAN (zackson.morgan)";
  6. WriteLine(pegaTexto(texto));
  7. texto = "ZACKSON MOREIRA MORGAN (zackson.morgan";
  8. WriteLine(pegaTexto(texto));
  9. texto = "ZACKSON MOREIRA MORGAN (";
  10. WriteLine(pegaTexto(texto));
  11. }
  12. public static string pegaTexto(string texto) {
  13. texto += ")";
  14. texto = texto.Substring(texto.IndexOf("(") + 1);
  15. return texto.Substring(0, texto.IndexOf(")"));
  16. }
  17. }
  18.  
  19. //https://pt.stackoverflow.com/q/54313/101
Success #stdin #stdout 0.02s 16704KB
stdin
Standard input is empty
stdout
zackson.morgan
zackson.morgan