[Gambas-user] how print each char/possition in string including spaces

Jussi Lahtinen jussi.lahtinen at ...626...
Thu Dec 10 19:20:33 CET 2015


I recommend to use String.Len() and String.Mid(), because they can handle
unicode characters.



Jussi

On Thu, Dec 10, 2015 at 7:51 PM, ML <d4t4full at ...626...> wrote:

> Gerardo,
>
> I think you speak spanish, I've been to your site. I'll switch to ES-AR.
> If I'm wrong, then please accept my apologies, tell me, and I'll repost
> in US-EN.
>
> Tenés que iterar con un FOR-NEXT teniendo en cuenta la longitud del
> string. Por ejemplo, pon esto en FORM_OPEN:
>
>   Dim myString As String = "Hello"
>   Dim pointer As Integer = 0
>
>   For pointer = 1 To Len(myString)
>     'Esto será MUY molesto, pero sirve para ejemplo. Además myString no
> es muy largo... ;)
>     Message.Info("Caracter en posición " & Str(pointer) & " es '" &
> Mid(myString, pointer, 1) & "'.")
>   Next
>
> El primer caracter en strings en Gambas tiene índice 1.
>
> Saludos.
>
> *On 2015-12-10 14:39, PICCORO McKAY Lenz wrote:*
> > of the chari have a String "var1" = "this its a string"
> >
> > how can i print each position/char of the string including the spaces!
> >
> > Lenz McKAY Gerardo (PICCORO)
> > http://qgqlochekone.blogspot.com
> >
> >
> ------------------------------------------------------------------------------
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list