Roger Daley Well-Known Member Licensed User Longtime User Aug 19, 2015 #1 Hi All, Without distracting you with the in's and out's, my program reads a line of text from a file that can be edited by the user. If the user uses notepad or notepad++ ASCII65279 [Non printable char] can be added to the start of the line. As I do a "string" comparison this extra char throws everything out of wack. The question is, once I have read the line of text how do I remove ASCII65279? I have tried Riedlyne Code: Copy Riedlyne = Riedlyne.Replace(Asc(65279),"") without success. I could test with something like Code: Copy if (Asc(Riedlyne.CharAt(0))) = 65279 then DoSomething to produce alternative string comparisons but that is messy. Regards Roger
Hi All, Without distracting you with the in's and out's, my program reads a line of text from a file that can be edited by the user. If the user uses notepad or notepad++ ASCII65279 [Non printable char] can be added to the start of the line. As I do a "string" comparison this extra char throws everything out of wack. The question is, once I have read the line of text how do I remove ASCII65279? I have tried Riedlyne Code: Copy Riedlyne = Riedlyne.Replace(Asc(65279),"") without success. I could test with something like Code: Copy if (Asc(Riedlyne.CharAt(0))) = 65279 then DoSomething to produce alternative string comparisons but that is messy. Regards Roger
DonManfred Expert Licensed User Longtime User Aug 19, 2015 #2 I suggest to save the file without BOM in your texteditor (see options). Maybe upload such a text file so we can have a look Upvote 0
I suggest to save the file without BOM in your texteditor (see options). Maybe upload such a text file so we can have a look
Roger Daley Well-Known Member Licensed User Longtime User Aug 19, 2015 #3 Thanks DonManfred but unfortunately the user gets to edit the text file. I can only have the program deal with the problem if it happens Roger Upvote 0
Thanks DonManfred but unfortunately the user gets to edit the text file. I can only have the program deal with the problem if it happens Roger
stevel05 Expert Licensed User Longtime User Aug 19, 2015 #4 Then Try Code: Copy Riedlyne = Riedlyne.Replace(Chr(65279),"") Upvote 0
Roger Daley Well-Known Member Licensed User Longtime User Aug 19, 2015 #5 Thanks stevel05, Worked perfectly. Like many things, it's obvious we someone else points you in the right direction. Regards Roger Upvote 0
Thanks stevel05, Worked perfectly. Like many things, it's obvious we someone else points you in the right direction. Regards Roger