Forum Discussion

LuisElCaminante's avatar
LuisElCaminante
Brass Contributor
Dec 29, 2023
Solved

I try to know which character I am facing

Hello, I am reading pdf information and I already got the text I was looking for, but this one has two characters at the beginning that I can't delete. Apparently, they are not simple spaces, becau...
  • djclements's avatar
    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!

Resources