Results 1 to 2 of 2
- 04-15-2010, 05:29 PM #1
Member
- Join Date
- Jan 2010
- Posts
- 16
- Rep Power
- 0
How do you trim part of a word off from an array?
I have a program which takes user input (which is a full sentence) and returns it as an array. if the sentence the user has input include keywords which are predefined, an SQL query is run.
my question is, if the user inputs a number, for example, £10000. how can i make sure that this amount is included in the SQL query, I know i need to make sure that the keyword includes the £ but then before i can transfer this amount into the SQL query, i need to take off the £ sign.
i'm not sure how to go about this at the moment.
thanks in advance.
- 04-15-2010, 05:40 PM #2
you could do a charAt(0) that checks if the first character in the string is that symbol and if so run valueOf() on the subString that goes from 1 to string length.
Liberty has never come from the government.
Liberty has always come from the subjects of government.
The history of liberty is the history of resistance.
The history of liberty is a history of the limitation of governmental power, not the increase of it.
Similar Threads
-
What will be output by the following code? using trim method.
By racewithferrari in forum New To JavaReplies: 4Last Post: 11-17-2009, 09:40 PM -
java longest word in array
By mayhewj7 in forum New To JavaReplies: 10Last Post: 04-24-2009, 01:39 AM -
How to trim the value in jrxml code
By Deepa in forum New To JavaReplies: 12Last Post: 01-03-2009, 08:27 AM -
How to trim text in viewer
By diva_garg in forum SWT / JFaceReplies: 4Last Post: 08-26-2008, 02:03 PM -
String trim
By Java Tip in forum Java TipReplies: 0Last Post: 01-21-2008, 04:35 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks