Bug? No warning or error

JdV

Active Member
Licensed User
Hello

I don't know if this is a bug or intentional but consider the following code:

B4X:
Dim MyString As String
MyString = "Hello world"
MyString.Replace("world", "everyone")
Log(MyString)
MyString = MyString.Replace("world", "everyone")
Log(MyString)
I'm assuming the line to replace "world" with "everyone" (line 3) is ignored as the first Log(MyString) outputs "Hello world".

The rest of the code behaves as expected so the second Log(MyString) outputs "Hello everyone".

Should the incorrect use of MyString.Replace on line 3 at least cause a warning or an error to appear in the logs?

Regards

Joe
 

JdV

Active Member
Licensed User
Thanks, that's the answer I was looking for.

I'll create a wish.
 
Top