Bug? Out of bounds on splitted string?

MathiasM

Active Member
Licensed User
Hello

When I try this simple line in an app, it crashes with an out of bounds exception.
Is this a bug, or am I something not seeing here?

B4X:
Log(Regex.Split(".", "Test.exe")(0))

Expected behaviour: A log that shows Test, as I splitted the string on the .
And showed the first (0) element of the array.

Thanks, sorry if I said something stupid.
 

MathiasM

Active Member
Licensed User
Nevermind, I forgot to escape my .
This works perfectly:
B4X:
Log(Regex.Split("\.", "Test.exe")(0))
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…