• Post Reply Bookmark Topic Watch Topic
  • New Topic

split method not working.  RSS feed

 
Mahe Singh
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to get resultset into a string and then use split method to store it in an array but it is not working. i tried to work it seperately as java program but it throws exception "could not find or load main class java."
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Refer to the javadoc. What does the split method expect as its first parameter? Hint: it's not a simple string.
 
Mahe Singh
Greenhorn
Posts: 9
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Issue resolved. actually . is a special character and it need escaping. thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exactly! Good work. The first argument is interpreted as a regular expression, so the "." has a special meaning.

Could you post your working code so others can see what you ended up with? Thanks!
 
ms tang
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
don't have a mian() method
 
Campbell Ritchie
Marshal
Posts: 56525
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!