How to check whether two elements are available in an array?

For example,
String str1="2"
String str2="3"
String [] str3={"2","4","8","9","3"};
Is there any feature available by default to check whether both str1 and str2 are contained in str3?
Or we can only compare by doing equals() and a loop?

cross posted in the java-forums.
Please do not cross-post questions in multiple forums. This will frustrate anyone who tries to help you only to find out later that the same answer was given hours ago in a cross-posted thread. For this reason, many volunteers here and at the other sites refuse to help repeat offenders.

Similar Messages

  • How to check whether system privilege are granted

    How to check whether system privileges like 'create session' and other ones are granted for user.
    Is there any sys table where this information is available?
    Regards - Neuron

    Keep in mind select * from dba_sys_privs where grantee = 'some-user' will give you a list of privileges granted to some-user directly. To get complete list of system privs granted to a user both directly an via roles use:
    ACCEPT USER PROMPT 'Please enter user name: '
    COLUMN PATH FORMAT A90
    SET LINESIZE 132
    SELECT  PATH,
            PRIVILEGE
      FROM  DBA_SYS_PRIVS,
              SELECT  'DIRECT GRANT' PATH,
                      '&USER' GRANTED_ROLE
                FROM  DUAL
             UNION ALL
              SELECT  LTRIM(SYS_CONNECT_BY_PATH(GRANTED_ROLE,'->'),'->') PATH,
                      GRANTED_ROLE
                FROM  DBA_ROLE_PRIVS
                START WITH GRANTEE = UPPER('&USER')
                CONNECT BY PRIOR GRANTED_ROLE = GRANTEE
      WHERE GRANTEE = GRANTED_ROLE
    /Now on top of privileges granted to a user, user also has privileges granted to PUBLIC. To get privileges user receives via PUBLIC run the above script specifying PUBLIC at the prompt.
    SY.

  • How to check wwheter two files are the same?

    Hi,
    I need to check wheter two files are the same. Their names and paths may be different. How to do that? Do u have any links / examples?
    Important notice: Files used in the application will be big (ie 1, 2gb)

    Comparing a hash, if you have to calculate it each
    time, is bound to be slower than a byte by byte, or
    character by character compare.
    This kind of comparison is used mostly in things like
    content management systems, when a new file of data
    is checked to see if it's identical to a file already
    entered, hash values being stored for each file
    already in the system.
    And comparing the hashes can only prove the files are
    different, if the hashes are equal that doesn't
    absolutely guarantee that the files are the same.
    Normally you'd confirm a matching hash by actually
    comparing file content.Depends on how good your hash is..but in general...yes. I was only saying that it's faster if you're always maintaining a has of the file.

  • How to check whether transport path exist between two systems in sld??

    Hi,
         I have two systems namely 'A' and 'B' and created business systems for both of them.Then i created transport path between the two systems.How i check whether what i have done is right in SLD.

    <b>WRT to CMS</b>
    am not sure with this but u can try:
    1. Start CMS: http://<host>:<J2EE Engine http port>/webdynpro/dispatcher/sap.com/tcSLCMS~WebUI/Cms.
    2. Goto lansdscape configurator and check there
    Message was edited by:
            Prabhu  S

  • How to check whether follow on document is created for sc or po,is there any table or fm available?

    How to check whether follow on document is created for sc or po,is there any table or fm available?

    Hello Venu
    Check FM: BBP_PD_SC_GETDETAIL and BBP_PD_PO_GETDETAIL table E_HEADER_REL
    Check this: SRM Shopping cart and PO tables link
    Regards

  • How to search whether a seat is available or not?

    Hi,
    I am developing a form in admin module for a call centre where there is a requirement to check whether a seat is available or not? The form contains a search window which the user enters the date in Location,catergory,From_date,to_date,time_from,time_to fields.
    For example if he enters time_from as 06:00and time_from as 14:00 .That means the seat is occupied for 8 hours but is available for the remaining 16 hours. So the search result should show this seat also in the availability list. Every seat hava a unique seat_id.
    another situation is a seat can be allocated between 22:00 and 06:00.That means it is crossing the day.That means that means in a day the seat is allocated from 00:00 - 06:00 and 22:00-23:59. How to search for this?
    The seat can be allocated for any number of hours in a day. It can be 2 hours .3 hours or 4 hours....means there is no particular time slot system.
    Can this be done using a sql query or plsql procedure?
    can anybody help me in this regard
    Thanking you,
    Deekshit

    Hi
    U can use the following query in function.
    SELECT CASE dumm
    WHEN 'X'
    THEN 'OK'
    END
    FROM (SELECT NVL (dummy, 'Y') dumm
    FROM DUAL
    WHERE TO_DATE (new_date_entered in varchar format, 'hh24:mi:ss') BETWEEN TO_DATE
    (date_from in varchar format,
    'hh24:mi:ss'
    AND TO_DATE
    (date_to in varchar format,
    'hh24:mi:ss'
    But need to b careful when the dates r changing. U can check dat by comparing time_from nd time_to values...in case of date change time_from value will be greater than time_to value(assumption==> seat can't be blocked for more than 12 hours). U can actually use the same query by reversing the conditions.. hope this will solve the problem
    Message was edited by:
    Arpit

  • How to check whether calendar is being used in any of the sap application

    Hello All,
    We are having few factory calendars. However some of the calendar having valid to year 2010. Can you please let me know how to check whether these calendar is being used in any of the sap application/module
    kindly reply as early as possible
    Regards
    Girish

    Hi RKS
    yesterday BLOG by our SUMMER WANG helps every SRM consultant to debug the PO error
    /people/summer.wang/blog/2010/05/11/trouble-shooting-of-srm-po-transfer-error
    Good work Summer wang !!
    Muthu

  • How to check Whether the File is in Progress or used by some other resource

    Hi All,
    I am retrieving a file from the FTP server using Apache commons FTP.
    I need to check whether the file is fully retrieved or in progress.
    for now i can able to use the file which is partially retrieved. it is not throwing any file sharing exception or i am unable to find whether it is in progress.
    How to check whether the file is in progress ? or The file is accessed by some other resource ?
    Pls Help me.
    Thanks,
    J.Kathir

    Hi Vamsi,
    Explicitly such kind of requirement has not been catered and i dont think you would face a problem because any application that is writing to a file will open the file in the read only mode to any other simultaneous applications so i think your concerns although valid are already taken care off .
    In the remote case you still face a problem then as a work around. Tell the FTP administrator to set the property to maximum connections that can be made to ftp as one. I wonder if you have heard of the concept of FTP handle , basically the above workaround is based on that concept itself. This way only one application will be able to write.
    The file adapter will wait for its turn and then write the files.
    Regards
    joel
    Edited by: joel trinidade on Jun 26, 2009 11:06 AM

  • How to check whether Output ES is working or not.

    I am able to see Output ES in the services list of the admin console of my server. Please let me know how to check whether this is working or not.
    Regards,
    Shabeer

    LiveCycle ES2 (and LiveCycle ES) ship with three undersold and unadvertised web applications that are VERY useful. Each is referred to as an Installation Verification Sample (or IVS) but they are great testing tools you can use during development and QA. There is
    1) Assembler IVS,
    2) Forms IVS, and
    3) Output IVS
    Output IVS looks like this...
    The pattern for deploying and using all three IVSs is very similar as what I am about to describe for Output IVS. The following directions apply to the JBoss turnkey on Windows.
    1) go to C:\Adobe\Adobe LiveCycle ES2\deploy and locate adobe-output-ivs-jboss.ear
    2) copy adobe-output-ivs-jboss.ear to C:\Adobe\Adobe LiveCycle ES2\jboss\server\lc_turnkey\deploy
    3) if necessary, start LiveCycle
    4) open a browser and go to http://localhost:8080/OutputIVS/
    5) click Check/Change your preferences
    6) add Admin Credentials
    7) click Save
    8) click Test your form designs
    9) Select an .xdp from Form designs
    10) Click Use EJB (or Use Web Service if you feel so inclined) to invoke LiveCycle Output ES2
    Steve

  • R12.1.1 staging complete! How to check whether the stage is Good

    Hi Gurusl,
    I have completed staging R12.1.1 for Hp unix B.11.31. I want to know how to check whether the stage is good for installation or whether it is corrupted. Is there any metalink note or script from where we can check it. Ur help will be highly appreciated. Thanks in advance
    regards,

    Hi,
    Please refer to (Note: 802195.1 - MD5 Checksums for R12.1.1 Rapid Install Media).
    Regards,
    Hussein

  • How to check whether there r new txt files in a folder n file creation date

    How to check whether there r new text files in a specified folder and what is the date of creation of the text file.........?

    Hi
    I have been searching for a solution to find the date of creation of a file for over 6 months now but haven't found it. So I presume that it is not possible though I havent found any authentication of my assumption in any document.
    Cheers!
    Shailesh

  • SAP Script - How to check a text element is empty in Script.

    Hello Friends,
                  I like to display a text element when it is not empty, otherwise I like to display some other text.
    I know how to read text element in Script, but 
    How to check a text element is empty in Script
    Thank you for your time.
    Senthil

    Hi Senthil,
    Inside text element, we print the variables.
    Variables actually gets printed in the form.
    if the variable contains value the variable gets printed on script. if not, then variable not gets printed.
    hope this helps.

  • How to check whether my sol man installation is on sol man 7.0 or?

    Hellol All,
    Can anyone help me How to check whether my sol man installation is on sol man 7.0 or sol man 7.0 EHP1.
    Thank you,
    Srihari

    Hi,
    Your system status should tell you that. Any logged in screen of your solution manager system --> Status. Component Version should be as "SAP EHP 1 for SAP Solution Manager 7.0" to be Ehp1 or "SAP Solution Manager 7.0"
    Hope this answers your question.
    Feel free to revert back.
    -=-Ragu

  • How to check whether the Application Server directory exits or not

    Hi,
    I have a selection screen in which I give the Application server file name(UNIX file) as input. Here, I would like to check whether the Server directory exists or not.
    Let us say, the path I gave in the selection screen is /usr/sap/tmp/testfile.txt . Here, the file name is testfile.txt and the server directory is /usr/sap/tmp . I would like to check whether this directory /usr/sap/tmp exists in the server or not. I am not bothered about the file name as I am going to write data into the file. I am mainly concerned about whether the directory exists in the server or not. and one more thing... this is the Application Server path not the Local path.
    Can anyone help me on the same how to check whether the server directory exists or not.
    Thanks in advance.
    Best Regards,
    Pradeep.

    Also you can use the FM EPS_GET_DIRECTORY_LISTING for this purpose.
      Store the directory name
        l_dpath = p_file+0(l_no).
      Validate the directory of the application server
        CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
          EXPORTING
            dir_name               = l_dpath
          TABLES
            dir_list               = l_i_dlist
          EXCEPTIONS
            invalid_eps_subdir     = 1
            sapgparam_failed       = 2
            build_directory_failed = 3
            no_authorization       = 4
            read_directory_failed  = 5
            too_many_read_errors   = 6
            empty_directory_list   = 7
            OTHERS                 = 8.
      If any problem occurs with the directory then display proper
      error message
        IF sy-subrc <> 0.
        Display error message
          MESSAGE e018 WITH 'Problem with directory entered'(008).
        ENDIF. " sy-subrc <> 0
    Regards,
    Joy.

  • How to check whether a Document in KM is classified or not using JAVA API

    Hello Everyone,
      Can anyone tell me, How to check whether a Document in KM is classified or not, using JAVA API's??
    Thanks & Regards,
    Adren D'Souza

    Hi,
    The code is as follows:
    IIndexService indexService = null;
    try {
       indexService = (IIndexService) ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
    } catch (ResourceException e) {
       if (indexService == null) {
         log.errorT("Error on instanciating the index service");
         return this.renderMessage(this.getBundleString(RES_NO_INDEX_SERVICE), StatusType.ERROR);
    // get index
    IIndex index = null;
    try {
       index = indexService.getIndex("YourIndexID");
    } catch (WcmException e1) {
       log.errorT("Error when trying to get the index");
       return this.renderMessage(this.getBundleString(RES_NO_INDEX), StatusType.ERROR);
    // check if the index is a instance of AbstractClassificationIndex
    AbstractClassificationIndex classiIndex = null;
    if (index instanceof AbstractClassificationIndex) {
       classiIndex = (AbstractClassificationIndex) index;
    } else {
       log.errorT("The index " + index.getIndexName() + " is no classification index");
       return this.renderMessage(this.getBundleString(RES_NO_CLASSIFICATION_INDEX), StatusType.WARNING);
    //give your KM Resource here for which you want to know if it is classified or not
    boolean classified = classiIndex.isDocClassifiedInAnyTax(resource);
    Regards,
    Praveen Gudapati

Maybe you are looking for

  • Satellite P500 PSPG8E - Bios peeps 3 time - one long two short

    Hello, I have a question: when I power on my Satelite P500 PSPG8E I get 3 Peeps: One long two short! What is this, maybe Memory? Thanks allot Greetings from Germany Michael Burkhardt

  • Need advice on SAP BW career

    Hi everyone, i just wanted your opinion on some SAP BW career questions, 1) Do i need to start with SAP FI/CO and then towarsd SAP BW in irder to become a real SAP BW professional or starting directly from SAP BW would be ok? 2) Do i need to know SQL

  • Workflow getting triggered when added/replace in Mask

    Hi Experts, We are using MDM 7.1 SP09 and we are facing an issue of workflow getting triggered when records are added or replaced in Mask.. ie whenever i am adding or replacing some records in mask workflow is triggered for most of the records ....IF

  • Quick keywording question

    I'm new to Mac's and Aperture, so this question probably looks stupid and it's easy to answer. I'm yet not quite familiar with the wording even though i read the key wording part in the manual and have tried to learn it. My main problem is as follows

  • Download failure - computer is frozen.

    Download hal message about - Could not install Mac OS - AdditionalVoiceSpeech.pkg