String.substring vs String[].split

前端 未结 5 1919
醉梦人生
醉梦人生 2021-01-17 09:24

I have a comma delaminated string that when calling String.split(\",\") it returns an array size of about 60. In a specific use case I only need to get the valu

5条回答
  •  盖世英雄少女心
    2021-01-17 09:59

    My first inclination would be to find the index of the first and second commas and take the substring.

    The only real way to tell for sure, though, is to test each in your particular scenario. Break out the appropriate stopwatch and measure the two.

提交回复
热议问题