Question with how to know if a String contains int,double,or common String?

I'm doing table sorting now and wanna make a "generic" method of comparing 2 Strings:
if they are common Strings , just use String.compareTo()
if they are int or double etc, compare which is bigger
BTW: I have thought about using try{...}catch{...} to catch NumberFormatException , but i don't wanna use this way.

check to see if each char is numeric? (or '.')....
I dont see much wrong with parseInt/parseDouble +
exception catching thothe compare() method is invoked hundreds and thousands times, so I guess using too much try{}catch{} is not a good thing, am I right?

Similar Messages

  • How to know the total string length of a range of cell in excel sheets

    Hi,
           I am working on Excel automation. I want to read data of collection of cells from excel for that i need to know the total string length in one shot.
    Can anyone suggest me the answer for this

    Still not sure about your requirements, but how about this
    SQL> CREATE OR REPLACE FUNCTION get_max_length(p_table in varchar2, p_col in varchar2) return pls_integer
      2  is
      3    v_cnt pls_integer;
      4  begin
      5    execute immediate 'select max(length('||p_col||')) from '||p_table into v_cnt;
      6    return v_cnt;
      7  end get_max_length;
      8  /
    Function created.
    SQL>
    SQL> SELECT COLUMN_NAME,
      2         DATA_LENGTH,
      3         get_max_length(TABLE_NAME, COLUMN_NAME) max_length
      4  FROM USER_TAB_COLUMNS
      5  WHERE TABLE_NAME='EMP'
      6  AND DATA_TYPE like '%CHAR%'
      7  ;
    COLUMN_NAME                    DATA_LENGTH MAX_LENGTH
    ENAME                                   10          6
    JOB                                      9          9
    SQL>

  • How to know which hard drive contains the OS in Hp Pavilion dv7-4069wm? Upgrading.

    I'm thinking about upgrading one of my hard drives (320GB ea) in my HP Pavilion dv7-4069wm laptop for more storage.  I would like to keep the drive that contains the OS to avoid the hassle of making a copy, but I'm not sure which one that is. I haven't replaced a hard drive before, let alone a dual drive. I recently added more RAM and noticed both hard drives looked the same. Can anyone tell me how to know the difference? . 
    This question was solved.
    View Solution.

    Hi,
    The primary HDD with the operating system is shown on the diagram on Page 49 of your Maintenance & Service Guide.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Question on how to retrieve elements in workflow container using WAPI

    Hi all, I need your great help. I have started a workflow and during it running I want get element in workflow container. First I use SAP_WAPI_READ_CONTAINER to get a workflow container which called "simple_container", but I can not get element using SWC_GET_ELEMENT because the container type I got does not match the type TABLE SWCONT. 
    I have loop the container and could see the elements in the container, but I am not quit sure that I can get the element with its own type. For example, I have an internal table in container, when I loop to it and get its value, it can not be assigned to my local internal table variable for the type incomptible.
    Could any one give me some advice? Thank you very much!

    Thanks for your advice. I think I have found the way to do that by inside into the source code sap provide. The steps are as follows:
    1 If the element you want get in container is char-based, just get container use 'SAP_WAPI_READ_CONTAINER' and loop into it to retrieve what you want.
    2 If you want get element in other types, eg, internal table, then use:
    lv_wi_handle TYPE REF TO if_swf_run_wim_internal,
    cnt TYPE REF TO if_swf_cnt_container.
    CALL METHOD cl_swf_run_wim_factory=>find_by_wiid
            EXPORTING
              im_wiid     = wi_id
            RECEIVING
              re_instance = lv_wi_handle.
          cnt = lv_wi_handle->get_wi_container( ).
    CALL METHOD cnt->IF_SWF_CNT_ELEMENT_ACCESS_1~ELEMENT_GET_VALUE
           EXPORTING NAME = 'element_name'
           IMPORTING VALUE = element_value.
    The variable element_value is just in your own type~.
    Hope it useful to you, the reader.

  • How to know whether a node contains a point after transformation?

    I have tried the contains function but i can't make it after transformation such as changing the scaleX,rotate or any other things.

    Answer by example:
    var scene: Scene;
    var rect: Rectangle;
    Stage
      title: "Forum Test"
      scene: scene = Scene
        width: 500
        height: 500
        fill: Color.LAVENDER
        content:
          rect = Rectangle
            x: 100
            y: 100
            width: 200
            height: 100
            arcWidth: 50
            arcHeight: 50
            fill: Color.web('#00BB00')
            stroke: Color.GREEN
            strokeWidth: 5
            onMousePressed: function (evt: MouseEvent): Void
              if (evt.primaryButtonDown)
                evt.node.rotate += 15.0;
                evt.node.scaleX *= 1.1;
              else
                evt.node.rotate -= 15.0;
                evt.node.scaleX /= 1.1;
          Rectangle
            width: 500
            height: 500
            fill: Color.TRANSPARENT
            onMouseMoved: function (evt: MouseEvent): Void
              var pt = rect.sceneToLocal(evt.x, evt.y);
              if (rect.contains(pt))
                rect.stroke = Color.RED
              else
                rect.stroke = Color.GREEN
    }

  • How to know the count of record in CR XI?

    Post Author: Liu ming
    CA Forum: Deployment
    Hi All,
    I create a report by CR XI release 2. The report is viewed in ASP.Net. So, I would like show a message when the report have no record. My question is how to know the count of record?
    Thanks.

    I was able to do this by using
    ora:countNodes('Receive_1_Read_InputVariable','BILL','/ns2:BILL/ns2:CMS1500')

  • How to know previous navigation item during runtime in Forms

    Hi,
    How can one know the previous navigation item in oracle forms.
    Scenario:
    Navigation: US Super HRMS Manager --> People --> Enter and Maintain.
    On the Find Person window --> Query a Person
    On the People Window, there is an Assignment Button. When clicked, it will open new window "Assignment".
    At this point 'WHEN-NEW-ITEM-INSTANCE' is fired for the item 'ASSGT. ORGANIZATION_NAME'.
    There is DFF on this window and when DFF is closed by pressing OK button, 'WHEN-NEW-ITEM-INSTANCE' is fired again for the item 'ASSGT. ORGANIZATION_NAME'.
    Hence my question is how to know if the previous item is DFF or not.
    Thanks in Advance.
    Vishnu

    Hi,
    How can one know the previous navigation item in oracle forms.
    Scenario:
    Navigation: US Super HRMS Manager --> People --> Enter and Maintain.
    On the Find Person window --> Query a Person
    On the People Window, there is an Assignment Button. When clicked, it will open new window "Assignment".
    At this point 'WHEN-NEW-ITEM-INSTANCE' is fired for the item 'ASSGT. ORGANIZATION_NAME'.
    There is DFF on this window and when DFF is closed by pressing OK button, 'WHEN-NEW-ITEM-INSTANCE' is fired again for the item 'ASSGT. ORGANIZATION_NAME'.
    Hence my question is how to know if the previous item is DFF or not.
    Thanks in Advance.
    Vishnu

  • How I know if company db is updated

    Hi all,
    a simple but I believe very important question. How I know if a user has accessed the company db? (I mean by execute insert and/or update in MSSQL).
    Are any logs to be checked?
    Thanks in advance,
    Vangelis

    Hello Vangelis,
    What do you exactly want?
    Would you like to see if an user is currently logged in? You can take a look in the sql manager, to see the "activity monitor". This info is also provided by an stored procedure which you can excute. You cann't check the SBO username.
    If you would like to know when the user is last logged in execute this query:
    select lastLogin, * from ousr
    HTH Regards Teun Aben

  • How to know  Partikular Attribute belongs to which Characteristic

    Hi, I have a doubt about Attribute,
    For example I have a info object 0REJECTN_ST ( Rejection Status ) , my question is How to know this Attribute belongs to which Characteristic , I have to load the Master Data for 0REJECTN_ST, when I am SD master data Info sources this is not available in master data info source , when I am going to create master data info source for 0REJECTN_ST, system is giving the message
    <b>Characteristic 0REJECTN_ST cannot be a master data InfoSource,</b>
    If I want to load status related data , How to load ?

    Shaik,
    ooks like the IOBJ was created without texts or attributes. You would not be able to load any textx or attributes against the same.
    use the where used option and find out where the IOBJ has been used and then you can look at how best you can att the descriptions to the IOBJ.
    Arun
    Assign points if helpful

  • How to know the items cost from the production order.

    Dear friends,
    When We close a production order, if we go to the summary tab we can see the total cost of the real component and cost of the real item.   My question is how to know the cost of every component used for the real product? I run the stock Audit  report, and there I see a field named Calcprice, in what table where can I find this field? to get the cost individual for each component in the moment i close the PO.
    Thanks a lot.
    Daniel

    Thanks a lot to everybody. 
    You are right Thanga,
    That is the data I need, but how can I get it via query because I dont find the field to know the cost in the exactly moment when is created the receipt of productiion.  I was trying to locate in tables IGN1 -- IGN12 but I dont get the cost field.
    Do you have any idea how can I make a report?
    Best Regards,
    Daniel

  • How to know Transparent gateway version

    dear all,
    Facts:
    WIN 2008 AND MSSQL SERVER 2008
    AIX 5.3 AND ORACLE 10.1
    how i know the version of Oracle Transparent Gateway from :
    - Oracle MS SQL Server 2008
    - Oracle 10.1
    how can i view that ???
    thanks a lot !!!

    Sorry, but it is not really clear what yo mean with:
    how i know the version of Oracle Transparent Gateway from :
    - Oracle MS SQL Server 2008
    - Oracle 10.1
    You can check the vesion of an installed gateway using Oracle Universal Installer which can list which products are installed or you can use opatch lsinventory -detail.
    You can also check the listener - it contains PROGRAM=<executble> and now type the name of the executable on the command line. It will now report which gateway and which version you've installed.
    If you're interested in which gateway can be used - then the only supported release is 11g which is certified with Oracle 10.1.0.5 + an additional gateway compatibility patch.

  • HT1311 I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    I know this is a basic question, however, how do i change my pass word on itunes to stop my kids from automatically buying tunes from the I store... as my card details are already saved they just log in with their ipods and download via my account

    http://support.apple.com/kb/HE36
    Regards.

  • I cannot purchase anything at the itunes store because I am being ask for my security questions, but I don't remember them. How do you change you security questions with out knowing them?

    I cannot purchase anything at the itunes store because I am being ask for my security questions, but I don't remember the answers. I tried going to appleied.apple.com but I won't allow me to change my security answerswithout answering the original questions. How do you change you security questions with out knowing them? I need help.

    Welcome to the Apple Community.
    Start here, and reset your security questions, you will receive an email to your rescue address, use the link in the email and reset your security questions.
    If that doesn't help or you don't have a rescue address, you might try contacting Apple through iTunes Store Support

  • I have problem with the security questions and i dont know the answer. How i change the questions ?

    I have problem with the security questions and i dont know the answer. How i change the questions ?

    See Here... ask to speak with the Account Security Team...
    Apple ID: Contacting Apple for help with Apple ID account security
    Or Here  >  Apple  Support  iTunes Store  Contact

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

Maybe you are looking for

  • Onedrive for business "the server is out of space"

    hi, - on premise SharePoint server 2013 - dedicated "my site" web application. - the sites collection has the right quotas - the server has a lot of space available. OneFor Business client app have a strange behaviour: - I synch small files < 1mb: wo

  • Discontinued part and follow up material

    Dear Guru, How to use discontinued and follow up material with effective date. I am using MTS Scenario. Please help. Regards, Sanjay Sahoo

  • Preview, OCR and pdf

    Hello, I've some trouble with pdf files. I've some pdf files scanned in "bitmap mode". I've used a Windows Software (PDF Xchange Viewer) to OCR the file (If you know some free software to do it on OSX, let me know). In my comprehension of the tool, i

  • Pages iOS says document unavailable

    Dear all, I recently created a document in pages for iOS on my ipad 2 on a cross-country flight. I just tried to access the document on my iPad 2 in pages and the document is unavailable with a message that an internet connection is required. I'm fig

  • How to print JOptionPane

    I am just trying to print something like JOptionPane.showMessageDialog( null, "Your number is", + result, JOptionPane.INFORMATION_MESSAGE); The output should be something like this: Your number is 5 It is greater than 3 This is a logical calculation