Results 1 to 2 of 2
  1. #1
    mitty is offline Member
    Join Date
    Jan 2010
    Rep Power

    Question 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.

  2. #2
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Houston, TX & Flint, MI
    Rep Power


    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

  1. What will be output by the following code? using trim method.
    By racewithferrari in forum New To Java
    Replies: 4
    Last Post: 11-17-2009, 09:40 PM
  2. java longest word in array
    By mayhewj7 in forum New To Java
    Replies: 10
    Last Post: 04-24-2009, 01:39 AM
  3. How to trim the value in jrxml code
    By Deepa in forum New To Java
    Replies: 12
    Last Post: 01-03-2009, 08:27 AM
  4. How to trim text in viewer
    By diva_garg in forum SWT / JFace
    Replies: 4
    Last Post: 08-26-2008, 02:03 PM
  5. String trim
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-21-2008, 04:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts