Hello everyone. I am facing a recurring problem that often puts my processes in error.
I use Excel files with contact email addresses. However often (due to human error) these lines contain “line breaks”.
I tried several techniques:
- I read my text
- I put it in a String variable
- I do a replace(Environment.Newline,“”) but also a replace(vbNewLine,“”)
but I can’t remove this line break.
Do you have a solution that can allow me to remove these line breaks?
row(column) = row(column).ToString().Replace(Environment.NewLine, “”)
row(column) = row(column).ToString().Replace(Environment.NewLine, String.Empty)
row(“ColumnName”) = row(“ColumnName”).ToString().Replace(vbCr, “”).Replace(vbLf, “”)
Use Trim function
In the Place of Fruits give Columnname
Hope it helps!!
Both of your methods work! THANKS
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.