Het downloaden van klingeltöne, Download von klingeltöne, Het downloaden van klingeltöne, Descargar tonos, Téléchargez des sonneries, scarica suonerie, Beltonen downloaden, Nedlasting av ringetoner, Download ringtones

Mono C# Shell

El otro día necesitaba saber bien cómo funcionaba el método Remove de la clase StringBuilder en Mono. Entonces hice lo siguiente:

miltondp@wasabi:~$ csharp
Mono C# Shell, type "help;" for help

Enter statements below.
csharp> using System.Text;
csharp> var a = new StringBuilder("Milton");
csharp> a.Remove(a.Length-1,1);
Milto
csharp> a.Remove(a.Length-1,1);
Milt
csharp> a.Remove(a.Length-1,1);
Mil
csharp> a.Remove(a.Length-1,1);
Mi
csharp> a.Remove(a.Length-1,1);
M
csharp> a.Remove(a.Length-1,1); 

csharp>

Si, funcionaba como me lo imaginaba :) Esta shell para C# está disponible en la versión 2.2 de Mono.

Google
 

  • http://nacho.larrateguy.com.ar Nacho

    Muy bueno! Y Booish? Capaz también te sirve, incluso para versiones anteriores (no se si con todas las funcionalidades pero si para probar).

  • http://www.miltonpividori.com.ar miltondp

    Aja, hasta ahora la opción para probar estas cosas era la shell de Boo. Pero ahora C# se hizo más booesco, y podemos embeber el compilador en nuestras aplicaciones.

  • http://nacho.larrateguy.com.ar Nacho

    No me acordaba lo buena que estaba la shell de Boo. Enriquezco esto dejando una pruebita :-D .

    nacho@nacho-laptop:~$ booish
    Welcome to booish, an interpreter for the boo programming language.
    Running boo 0.8.1.2865 in CLR v2.0.50727.42.
    
    The following builtin functions are available:
        /d[ir] type : lists the members of a type
        /h[elp] type : prints detailed information about a type
        /l[oad] file : evals an external boo file
        /s[ave] file : writes your current booish session into file
        /g[lobals] : returns names of all variables known to interpreter
        /n[ames] : namespace navigation
        /q[uit] : exits the interpreter
    
    Enter boo code in the prompt below.
    >>>import System.Text.RegularExpressions
    >>>import System.Text
    >>>cadena = StringBuilder("SAN MARTIN 570 D-1 P-2")
    SAN MARTIN 570 D-1 P-2
    >>>eregstr = "([A-Z]+ [0-9]+)(.*)"
    '([A-Z]+ [0-9]+)(.*)'
    >>>ereg= Regex(eregstr,RegexOptions.Compiled | RegexOptions.IgnoreCase)
    ([A-Z]+ [0-9]+)(.*)
    >>>ereg.isMatch(cadena.ToString())
    ---------^
    ERROR: 'isMatch' is not a member of 'regex'. Did you mean 'IsMatch' ?
    >>>ereg.IsMatch(cadena.ToString())
    true
    >>>ereg.Match(cadena.ToString())
    MARTIN 570 D-1 P-2
    >>>ereg.Match(cadena.ToString()).Groups
    System.Text.RegularExpressions.GroupCollection
    >>>for x in ereg.Match(cadena.ToString()).Groups:
    ...    print x
    ...
    MARTIN 570 D-1 P-2
    MARTIN 570
     D-1 P-2
    >>>
    
  • http://www.miltonpividori.com.ar miltondp

    Yo tampoco me acordaba lo grosa que estaba! Gracias Nacho por el aporte.