Effective way of String splitting
Posted
by openidsujoy
on Stack Overflow
See other posts from Stack Overflow
or by openidsujoy
Published on 2010-05-22T04:38:10Z
Indexed on
2010/05/22
6:10 UTC
Read the original article
Hit count: 210
I have a completed string like this
N:Pay in Cash++RGI:40++R:200++T:Purchase++IP:N++IS:N++PD:PC++UCP:598.80++UPP:0.00++TCP:598.80++TPP:0.00++QE:1++QS:1++CPC:USD++PPC:Points++D:Y++E:Y++IFE:Y++AD:Y++IR:++MV:++CP:~ ~N:ERedemption++RGI:42++R:200++T:Purchase++IP:N++IS:N++PD:PC++UCP:598.80++UPP:0.00++TCP:598.80++TPP:0.00++QE:1++QS:1++CPC:USD++PPC:Points++D:Y++E:Y++IFE:Y++AD:Y++IR:++MV:++CP:
this string is like this
- It's list of PO's(Payment Options) which are separated by ~~
- this list may contains one or more
- PO contains only Key-Value Pairs which separated by :
- spaces are denoted by ++
I need to extract the values for Key "RGI" and "N".
I can do it via for loop , I want a efficient way to do this. any help on this.
© Stack Overflow or respective owner