[RESOLVED] VB 2008 Replacing characters with no visual representation
my OCR copy text to a TextBox with “” at end, “” acts like enter key. Is it possible to replace it to something or remove it? For example, I want to copy number “1000” to my text box with OCR but I get “1000”(it’s a little different boxes, I couldn’t copy exact ones here). And I can’t do
Code:
TextBox2.Text = TextBox2.Text.Replace("", "")
, because is an "enter key" and what I get looks like that:
Code:
TextBox2.Text = TextBox2.Text.Replace("
", "")
Please help. I can't get rid of them :cry:
Re: VB 2008 Replacing characters with no visual representation
Would something like this work:
Code:
TextBox2.Text = TextBox2.Text.Replace(vbNewLine, "")
Re: VB 2008 Replacing characters with no visual representation
Are you sure it's the newline character? To find out what it really is, read the ascii value of the character(s) and look it up in an ascii table. Once you know exactly what it is, you can easily remove it using string.replace function.
Re: VB 2008 Replacing characters with no visual representation
Code:
TextBox2.Text = TextBox2.Text.Replace(vbNewLine, "")
Works perfectly thanks :afrog: