Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Use delimeter

 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ...
I am now starting a topic and i want to use multiple delimeters to break a file

something like this
person is the 1 nice name of 2 of this type 3 and bla bla bla 4 and blablabla 5
and i want to break the lines where the numbers are
i use usedelimeter("[1-50]") but it does not work
can someone help me ???
Scanner scanner=new Scanner(file);
scanner.useDelimiter("[1-50]");
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably because [1-50] is defining a character range, not a numeric range.
 
peter kosmas
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found it
scanner.useDelimiter("[0-9]+");
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic