How can i replace "Enter" in one of fields in the database with space
actually I have tried the below codes in vb.net, but non of them is working for me ,,
address = Replace(address, System.Environment.NewLine, " ")
or
address = Replace(address, vbNewLine, " ")
or
address = Replace(address, Chr(13), "")
Language : Vb.net database : MSSQL 2005
Thanks in advance
Click on the Find button. To replace the hard return with a space character, type a space in the Replace with field, then click the Replace button. To replace the hard return with nothing (remove the character), click the Replace button (without entering anything in the Replace with field).
(1) In the Find What box press Ctrl + J keys to enter alt-enter character; (2) In the Replace with box type space or comma as you need; (3) Click the Replace All button.
Press the Tab key on the keyboard, to move to the Replace With box. Type a space character. Click Find Next or Find All, to find the cells with line breaks. Click Replace or Replace All, to replace the line breaks with space characters.
If you want to replace new-line chars in SQL-Server.
So if you want to update a column and replace NewLines with white-spaces:
UPDATE TableName SET address=REPLACE(REPLACE(address, CHAR(13),' '), CHAR(10),' ');
Tab char(9)
REPLACE(REPLACE(REPLACE(address, CHAR(13),' '), CHAR(10),' '), CHAR(9),' ')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With