Problema Para Contar Caracteres Con Tilde Con Len[Resuelto]


Subject: Problema Para Contar Caracteres Con Tilde Con Len[Resuelto]
buenas,

quiero contar caracteres de palabras... pero las palabras len no las cuenta bien

ya se que en una palabra con tilde el tilde es un carácter aparte.

la cuestión es como contar palabras con tilde si que se contabilice el tilde.

les a pasado eso? como lo resolvieron?

pensando ahora mismo.. tal vez poner un contador y cuando se detecte á é í ó ú sume en un contador y eso se le reste a

palabra tiene:"&Len(palabrax)-contador&" caracteres"


que les parece este tema?

Last edited by v3ctor on Wednesday, 12 October 2016, 11:41; edited 1 time in total
Subject: Re: Problema Para Contar Caracteres Con Tilde Con Len
Citar:

Most of these functions only deal with ASCII strings. To manipulate UTF-8 strings, use the UTF-8 equivalent method of the String class indicated in the third column.

If no UTF-8 equivalent function is indicated, then the ASCII function also works with UTF-8 strings.


Ver: http://gambaswiki.org/wiki/cat/string

Y en especifico: http://gambaswiki.org/wiki/comp/gb/string/len

Saludos.

Subject: Re: Problema Para Contar Caracteres Con Tilde Con Len
La pregunta se ha resuelto en varios hilos anteriores en este foro, alguno bastante reciente. Usa el buscador...

Saludos

Profile PM  
Subject: Re: Problema Para Contar Caracteres Con Tilde Con Len
Tenes que usar string.len() en vez de len() a secas.

Saludos.

Profile PM  
Subject: Re: Problema Para Contar Caracteres Con Tilde Con Len
tincho escribió: [Ver mensaje]
Tenes que usar string.len() en vez de len() a secas.

Saludos.


efectivamente esa es la respuesta

stringlen

Public Sub btnEjecutar_Click()
Dim valor As String
Dim a As Integer

Inc Application.Busy

DicContador = New Collection

BuscarTextoElegido(subR1.ObtenerNombreTabla(cbxLibros.Current.Text))

tvPalabras.Rows.Count = DicContador.Count

For Each valor In DicContador
tvPalabras[a, 0].Text = DicContador.Key
tvPalabras[a, 1].Text = valor
tvPalabras[a, 2].Text = String.Len(DicContador.Key) 'aquí
Inc a
Next

Dec Application.Busy

End

Subject: Re: Problema Para Contar Caracteres Con Tilde Con Len[Resuelto]
Como regla general conviene usar:
String.Byte
String.Chr
String.Code
String.Comp
String.InStr
String.Index
String.IsValid
String.LCase
String.Left
String.Len
String.Lower
String.Mid
String.Pos
String.RInStr
String.Right
String.UCase
String.UCaseFirst
String.Upper

Por experiencias previas Upper y Lower me dieron problemas pero sin embargo String.UCase y String.LCase no lo hicieron.

Saludos.

Profile PM  

Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Design by DiDiDaDo

Generation Time: 0.1287s (PHP: -34% SQL: 134%)
SQL queries: 24 - Debug Off - GZIP Enabled