I have created very simple function that should return the first array after splitting it with a char.
int add(String version){
splitVersion = version.split('.')
echo splitVersion[0]
}
I'm calling the function like that: add("1.0.0")
And right after that I"m receving this error:
java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds for length 0
It's seem to be that it's not acting like a String at all, and when I try to print version it's print the value that sent(1.0.0)
What could be the issue?
Thanks!