-
Type:
Bug
-
Resolution: Not A Defect
-
Priority:
Minor
-
Component/s: groovy-plugin, pipeline
-
None
-
Environment:Jenkins 2.164.1
Pipeline:groovy 2.70
Â
Hello! When i use .slit() method with '.' as delimiter, it's work incorrectly. If i use any other char, like ',' - it's work as expected, but not with '.'
Â
Problem code:
script {
RC_FILES = '4,5,6'
println RC_FILES.getClass()
VERSION_TAIL_0 = '1.2.3'
println VERSION_TAIL_0.getClass()
ARRAY01 = RC_FILES.split(",")
ARRAY02 = VERSION_TAIL_0.split('.')
ARRAY01.each {
println("$it")
}
ARRAY02.each {
println("$it")
}
}
Expected output:
Â
Â
[Pipeline] echo class java.lang.String [Pipeline] echo class java.lang.String [Pipeline] echo 4 [Pipeline] echo 5 [Pipeline] echo 6 [Pipeline] echo 1 [Pipeline] echo 2 [Pipeline] echo 3
Current output:
Â
Â
[Pipeline] echo class java.lang.String [Pipeline] echo class java.lang.String [Pipeline] echo 4 [Pipeline] echo 5 [Pipeline] echo 6
Â