read specific substring with condition

I have this from text file: 134.897 134.4565 135.134 I read them using : while (( line = buffreader.readLine()) != null) { String[] parts = line.split(" "); String x1 = (parts[0]); String x2 = (parts[1]); String x3 = (parts[2]); From the String in the text file : 134.897 134.4565 135.134 I just want to take the **different number** between these three number : 4.897 4.4565 5.134 Given more example : Text file : 101.435 101.423 101.322 Number I want to take : 435 423 322 My plan is I want to compare each number with others, 101.435//x1 101.423//x2 101.322//x3 if x1.substring(0)=x2.substring(0)=x3.substring(0) then remove substring(0). I want to loop this "if" condition until the substring are not same. Please give me some idea, thanks
How come the results of your first example include decimal points while those of your second example do not?

以上就是read specific substring with condition的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏