Forum Discussion
I try to know which character I am facing
- Dec 29, 2023
LuisElCaminante You've already done everything correct to identify the two leading characters (13 = Carriage Return; 10 = Line Feed), and the Replace method is working. The only mistake you've made is to use documento as the Expression argument when defining dc both times... the second time, dc should have been used as the Expression argument.
You really only need one variable, documento, which can be redefined and reduced after each use of Replace. For example:
documento = Trim(vector(0)) documento = Replace(documento, Chr(13), "") documento = Replace(documento, Chr(10), "")Or you can combine all three steps into one line:
documento = Replace(Replace(Trim(vector(0)), Chr(13), ""), Chr(10), "")I hope that helps. Cheers!
LuisElCaminante You've already done everything correct to identify the two leading characters (13 = Carriage Return; 10 = Line Feed), and the Replace method is working. The only mistake you've made is to use documento as the Expression argument when defining dc both times... the second time, dc should have been used as the Expression argument.
You really only need one variable, documento, which can be redefined and reduced after each use of Replace. For example:
documento = Trim(vector(0))
documento = Replace(documento, Chr(13), "")
documento = Replace(documento, Chr(10), "")
Or you can combine all three steps into one line:
documento = Replace(Replace(Trim(vector(0)), Chr(13), ""), Chr(10), "")
I hope that helps. Cheers!