import java.util.Arrays; import java.util.List; public class date { public static void main(String[] args) { String distance = "1.0081298988162395,4.72588340867888,5.4820888270348505,5.9385314034051335,5.390557550035925"; List<String> lis = Arrays.asList(distance.split(",")); for (int i=0;i<lis.size();i++){ String dis = lis.get(i); double d = Double.parseDouble(dis); if (d<10){ System.out.print("True"); } else { System.out.print("False"); } } } }
注意:
List<String> lis = Arrays.asList(distance.split(",")); jemter中没有这个写法
jmeter中应该写成:
List lis = Arrays.asList(distance.split(","));