This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use "Pattern" class as delimiters for Scanner?  RSS feed

 
Fendel Coulptz
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

in a string "abcd<<<<1234^^^^", if i want only abcd and 1234, what should i type in the Scanner scanscan = new Scanner(System.in).useDelimiter(...) method? how do i use the Pattern class? i've read the api page, tried the stuff on the list but can't manage to compile.

thanks alot.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you post a short bit of what you have. That will help us see just what is hanging you up ... regular expression syntax, the Scanner API or something else.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!