Unable to parse ^ character

前端 未结 3 941
情深已故
情深已故 2021-01-27 15:06

Okay, Now I am able to parse space which was my previous problem. Now my parser is almost ready but has a defect which I am unable to figure out.

I am able to retrieve D

3条回答
  •  无人及你
    2021-01-27 15:55

    Scanner() by default has space as delimeter. So if you do scanner.next() again then you will get the remaining input part, '4'.

    You can set your own delimeter by using usedelimeter(String pattern) api of Scanner class.

提交回复
热议问题