Leer lineas de un textbox

02/03/2005 - 01:04 por Mariano Bertholet | Informe spam
Hola a tod@s

Queria saber si se puede hacer y de que manera leer linea por linea el texto
ingresado en un textbox multilinea.

Desde ya muchas gracias

Preguntas similare

Leer las respuestas

#1 Octavio Telis Aynés
02/03/2005 - 01:34 | Informe spam
Se me ocurre así de mucha prisa...

Dim str as string() = txtMultilinea.Text.Split(System.Enviroment.NewLine)

El detalle será que viene con un caracter 10, sin embargo lo puedes sustitur
al leer la cadena de esta manera:

MiVarStr = str(0).Replace(Convert.ToChar(13),"")

Ahora bien lo puedes recorrer con un For each:

For Each strg as String in str
MiVarStr = strg.Replace(Convert.ToChar(13),"")
Next

En fin... algo rápido...

espero te sea útil

Saludos...

Octavio Telis Aynés
www.comunidadpuntonet.org


"Mariano Bertholet" escribió en el mensaje
news:%
Hola a

Queria saber si se puede hacer y de que manera leer linea por linea el


texto
ingresado en un textbox multilinea.

Desde ya muchas gracias


Respuesta Responder a este mensaje
#2 Carlos Xudiera
02/03/2005 - 18:21 | Informe spam
Aqui esta el ejemplo que tiene la documentacion

Public Sub ViewMyTextBoxContents()
Dim counter as Integer
'Create a string array and store the contents of the Lines property.
Dim tempArray() as String
tempArray = textBox1.Lines
'Loop through the array and send the contents of the array to debug
window.
For counter = 0 to tempArray.GetUpperBound(0)
System.Diagnostics.Debug.WriteLine( tempArray(counter) )
Next
End Sub


"Mariano Bertholet" wrote in message
news:#
Hola a

Queria saber si se puede hacer y de que manera leer linea por linea el


texto
ingresado en un textbox multilinea.

Desde ya muchas gracias


email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida