Results 1 to 2 of 2

Thread: GetType?

  1. #1
    Join Date
    Jul 2011
    Posts
    47
    Rep Power
    0

    Default GetType?

    i want GetType of a string ...
    if it was a furmula like a+b return string , if it was number like 123 return number.

    can i use this or not?
    contain.getClass().equals(Integer.class)
    contain.getClass().equals(String.class)

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,985
    Rep Power
    9

    Default Re: GetType?

    Quote Originally Posted by HearT.Hunt3r View Post
    i want GetType of a string ...
    if it was a furmula like a+b return string , if it was number like 123 return number.

    can i use this or not?
    contain.getClass().equals(Integer.class)
    contain.getClass().equals(String.class)
    What happened when you tried that?

    You might want to take a look at the Pattern class.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

Similar Threads

  1. Replies: 4
    Last Post: 05-12-2010, 11:05 AM

Posting Permissions

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