• Post Reply Bookmark Topic Watch Topic
  • New Topic

String Separation  RSS feed

 
Rodricks george
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

QS="PRN=583945|ITC=1050306|AMT=1.0|CRN=INR|RU=https://testadm1.baazee.com/jsp/OrderOnlineBankTransferPaymentResponse.jsp?BZENTITYID1=21|CG=Y"



The above is one String �. There is a separator �|�... The output I want is

PRN=583945

ITC=1050306

AMT=1.0

�. Etc �. Pls give some idea.

Regards,

Rodricks G.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rodricks george:
... Pls give some idea...

One idea is to check the API documentation for the String class, and see if there's a method that will split a String.
 
Petrus Pelser
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out the Scanner class in the Java API.
 
janaki varma
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rodricks george:
Hi ,

QS="PRN=583945|ITC=1050306|AMT=1.0|CRN=INR|RU=https://testadm1.baazee.com/jsp/OrderOnlineBankTransferPaymentResponse.jsp?BZENTITYID1=21|CG=Y"



The above is one String �. There is a separator �|�... The output I want is

PRN=583945

ITC=1050306

AMT=1.0

�. Etc �. Pls give some idea.

Regards,

Rodricks G.


To make it simple try this

[solution deleted]

Hope this helps
[ February 13, 2008: Message edited by: Fred Rosenberger ]
 
Campbell Ritchie
Marshal
Posts: 56581
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Janaki Varma, thank you, but it is not the policy of the Ranch to give answers like that, least of all on the beginners' forum.

BTW: StringTokenizer ought not to be used; it is classed as legacy code in the API, so please use Marc Weber and Petrus Peiser's suggestions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!