EdiSimoes Posted February 18, 2012 at 12:11 PM Report Share #440208 Posted February 18, 2012 at 12:11 PM Ola a todos, tenho uma variavel tipo string assim: Dim linhaTexto As String essa variavel esta recebendo o valor de um arquivo de texto, que esta chegando assim : "8888888" , quero que esse valor seja exibido na textbox sem as aspas, alguem pode me ajudar, por favor??? Edi Carlos Simões Estudante de Análise e Desenvolvimento de Sistemas edisimoes@bol.com.br http://www.desenvolvenetma.com.br http://analisedesistemas.bl.ee Link to comment Share on other sites More sharing options...
ribeiro55 Posted February 18, 2012 at 12:24 PM Report Share #440211 Posted February 18, 2012 at 12:24 PM Se vem com aspas é porque já o estás a ler mal do ficheiro, ou porque o próprio ficheiro tem o valor com as aspas. Como é que estás a fazer a leitura? Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
EdiSimoes Posted February 18, 2012 at 01:04 PM Author Report Share #440221 Posted February 18, 2012 at 01:04 PM Estou lendo assim, mais é igual vc falou, o ficheiro ja esta com aspas, eu preciso remover elas, o codigo é esse: Dim fileName As String = "c:\Peso.txt" ' Guarda num Array linha a linha Dim lines() As String = IO.File.ReadAllLines(fileName) ' Ciclo que irá mostrar linha a linha For Each line As String In lines txtTara.Text = (line.ToString) Edi Carlos Simões Estudante de Análise e Desenvolvimento de Sistemas edisimoes@bol.com.br http://www.desenvolvenetma.com.br http://analisedesistemas.bl.ee Link to comment Share on other sites More sharing options...
ribeiro55 Posted February 18, 2012 at 01:13 PM Report Share #440222 Posted February 18, 2012 at 01:13 PM Se as aspas já vêm do ficheiro basta-te um replace. Dim fileName As String = "c:\Peso.txt" ' Guarda num Array linha a linha Dim lines() As String = IO.File.ReadAllLines(fileName) ' Ciclo que irá mostrar linha a linha For Each line As String In lines txtTara.Text = line.Replace(Chr(34), "") Next Não relacionado, não sei se será intenção, mas esse tipo de leitura fará com que fique na txtTara apenas o último valor do ficheiro. Se o ficheiro tiver: "456" "78" "12" "23" "45" Na txtTara apenas fica 45 Sérgio Ribeiro "Great coders aren't born. They're compiled and released""Expert coders do not need a keyboard. They just throw magnets at the RAM chips" Link to comment Share on other sites More sharing options...
EdiSimoes Posted February 18, 2012 at 01:59 PM Author Report Share #440229 Posted February 18, 2012 at 01:59 PM Valeu Sergio, isso msm que eu preciso. Muito obrigado e até a próxima. Edi Carlos Simões Estudante de Análise e Desenvolvimento de Sistemas edisimoes@bol.com.br http://www.desenvolvenetma.com.br http://analisedesistemas.bl.ee Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now