This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

StringTokenizer Usage in Oracle Field Values???!!

 
nabhilash
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends
I have got a typical problem.
I have got a field in applet where in the customer can enter his Car Registration number like MH-10/GHTRE-4522.ok.
By checking this number at my backend i retrieve the latest details of his car loans to the customer.
Now Conditions/validations is that the customer should not be forced to enter [/ - ,.] etcs in the applet field.
He may enter directly MH10GHTRE4522 WITHOUT ANY [/.!] etc's.
Now I removed these [/!--] from my applet field before sending data to my servlet using StringTokenizer function.
But now problems arise how to check these values at backend!! In oracle is there any wya to remove all these / -' etcs ..
Can anyone help me
Solution urgently needed Thanks in advance
 
Ambrose Tati
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,
In Oracle there's a function called replace that you can use.
Examples:
1) To remove all instances of the letter "C" in string
"CAT CALL", a call to replace('CAT CALL','C') will return a
string containing 'AT ALL'
2) To replace all occurrences of "99" with "100" in string
"Zero defects in period 99 reached 100%!", a call to
replace('Zero defects in period 99 reached 100%!',
'99',
'100') will return a string containing
'Zero defects in period 100 reached 100%!'

Hope this is what you're looking for.
Cheers
Ambrose
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic