-4

I have a simple string with the value "45.7961887"

I want split this variable using the "." as separator.

But when split, the string array result is empty.

Image with the value: Image with the string value

Now, with the split: Image with the split

ADM
  • 20,406
  • 11
  • 52
  • 83
AlexQL
  • 13
  • 5
  • Don't post code as images – Maurice Perry May 27 '19 at 05:35
  • You need to escape the . character because split takes a regEx as input and dot is meta character for Regular Expression /.. Read the link above . Also Android Studio has nothing to do with it neither Android .. its only Java basics ,, – ADM May 27 '19 at 05:39

1 Answers1

-1

Did you escape the dot? string.split("\\.") or string.split("[.]")

Maurice Perry
  • 9,261
  • 2
  • 12
  • 24