D Dirk A Member Licensed User Longtime User May 22, 2013 #1 Hello, I've got a string that contains about 32kb of data . Throughout the string there are clusters of 'FF' blocks . I want to replace them using the B4X: str.replace function, but afterwards when the string is written to a file I see that not all 'FF' blocks are replaced . Even though B4X: str.IndexOf("FF") gives me -1 this is the replace command : B4X: str = str.Replace("FF","AA")
Hello, I've got a string that contains about 32kb of data . Throughout the string there are clusters of 'FF' blocks . I want to replace them using the B4X: str.replace function, but afterwards when the string is written to a file I see that not all 'FF' blocks are replaced . Even though B4X: str.IndexOf("FF") gives me -1 this is the replace command : B4X: str = str.Replace("FF","AA")
agraham Expert Licensed User Longtime User May 22, 2013 #2 Check your code carefully. I really don't believe that the string contains any "FF" sequences if IndexOf returns -1. Upvote 0
Check your code carefully. I really don't believe that the string contains any "FF" sequences if IndexOf returns -1.
klaus Expert Licensed User Longtime User May 22, 2013 #3 What do you mean with "FF" ? Two times the letter F or do you mean the FormFeed character ? If FF means FormFeed you should use: str = str.Replace(Chr(12), "AA") or replace "AA" by something else depending on what AA means. Best regards. Upvote 0
What do you mean with "FF" ? Two times the letter F or do you mean the FormFeed character ? If FF means FormFeed you should use: str = str.Replace(Chr(12), "AA") or replace "AA" by something else depending on what AA means. Best regards.
D Dirk A Member Licensed User Longtime User May 22, 2013 #4 You guys were right , it was in my code replace function works fine ! Upvote 0