Plz Help me: how to find two different Expressions (Objects Strig)are equal

Actaully I m having a problem i have the situation
Suppose i have two String objects s1="Hotel in Paris" and s2="Paris in Hotel"
means if we have to String then by considering the permutations on first String we have serch out that whether it is foud in second string or not: e.g
String s1= "computer notebook sony";
String s2=" sony computer notebook ";
How to find that these two Objects or your can say "expressions" are equal in java ..................................................................................................Please Tell , if any one have any idea abt it
many many Thanks in Advance

This won't work with duplicate words, will it? well, maybe, since you are putting both strings in sets. But then, how would this handle capitalization? This is my ugly solution:
     public static void main(String[] args) throws Exception {
          String s1= "computer notebook sony";
          String s2=" sony Computer notebook ";
          s1 = s1.toLowerCase();
          s2 = s2.toLowerCase();
          String [] words1 = s1.split("\\b");
          for(String w : words1)
               s2 = s2.replace(w,"");
          if(s2.trim().length() == 0)
               System.out.println("The strings are equal");
          else
               System.out.println("They are not equal.");
     }~Tim

Similar Messages

  • I have lost my iphone 5 and after sometime I find it in my office but some one has lock it by Icoloud plz help me how to recover my phone

    Dear Friends
    I have lost my iphone 5 in my office  and after sometime I find it in my office in my back drawer but some one has lock it by ICloud plz help me how to recover my phone U have all details of my phone.

    The only way to locate/disable/erase any lost/stolen iPhone/iPod Touch is through Find My Phone or a similar app. However, this requires that Find My Phone be setup/activated, on your phone, before it was lost/stolen. You would then login at iCloud.com & try to locate it. This requires the phone be turned on & have an Internet connection. There is no other way to locate a lost/stolen iPhone. Apple can't/won't help you, nor will your carrier. Report the loss to the Police, your carrier & Insurance company. Change all of your passwords, especially your Apple ID/iCloud password NOW!
    If your carrier offers Blacklisting & they Blacklist the phone, it will be unusable as a phone.
    If locked with a passcode, and running iOS 7.0, then phone cannot be re-activated or the passcode removed without knowing your Apple iD/Password. It will be nothing but a useless paperweight.
    If not running iOS 7.0, the phone can be forced into recovery mode & restored.

  • Hi, i am from india, im using iphone3gs with ios5.1.1 .i want to update the same to ios6 or to ios7,but i couldnt find the software update option in my iphone,so plz help me how to update my software.

    hi, i am from india, im using iphone3gs with ios5.1.1 .i want to update the same to ios6 or to ios7,but i couldnt find the software update option in my iphone,so plz help me how to update my software.

    Are you sure it's a 3GS? What is the model number?

  • How to find the difference in object definition between two databases

    Hi,
    Can any one suggest me how to find the difference in object definition between two different databases. Is there any tool or by OEM? If so how?
    Regards
    Naveen

    this link may be helpful...
    http://www.dbspecialists.com/scripts.html

  • How to Maintain two different prices for same material in different qty?

    Dear all,
    How to maintain two different prices for same material in different batch quantities in purchase order(ie.,info record)?
    (Vendor is supplying quantities in 2 different batches & also in different prices)
    Expecting valuable reply.
    Jeyakanthan

    In a PO you can create 2 items, and each item can be maintained with a different price in the conditions.
    In info record it is not possible to have different prices for the same period, except for scales.
    so if you have a price of e.g. 2 USD for 1000 kg and 1,90 USD for 2000 kg then you can maintain this in scales, but you still have to have 2 items in the PO so that each one can individually find its price.
    Alternative you can create contracts (as well with more than one item) to reflect the different prices and batches.

  • How to find those different namespaces in schema?

    Hi,
    I heard that schema contains different name spaces. how to find those different namespaces in schema?
    I checked with this but it is throwing "table or view doesn't exist".
    select namespace from v$librarycache;
    Thanks
    Praveen

    Are you referring to this? From the SQL Language Reference manual under Schema Object Names and Qualifiers
    7. Within a namespace, no two objects can have the same name.
    The following schema objects share one namespace:
    Tables
    Views
    Sequences
    Private synonyms
    Stand-alone procedures
    Stand-alone stored functions
    Packages
    Materialized views
    User-defined types
    Each of the following schema objects has its own namespace:
    Indexes
    Constraints
    Clusters
    Database triggers
    Private database links
    Dimensions
    Because tables and views are in the same namespace, a table and a view in the same schema cannot have the same name. However, tables and indexes are in different namespaces. Therefore, a table and an index in the same schema can have the same name.
    Each schema in the database has its own namespaces for the objects it contains. This means, for example, that two tables in different schemas are in different namespaces and can have the same name.
    Each of the following nonschema objects also has its own namespace:
    User roles
    Public synonyms
    Public database links
    Tablespaces
    Profiles
    Parameter files (PFILEs) and server parameter files (SPFILEs)
    Because the objects in these namespaces are not contained in schemas, these namespaces span the entire database.Which is why you can do:
    SQL> create table t (id number, descr varchar2(10));
    Table created.
    SQL> alter table t add constraint t check (mod(id,2) = 0);
    Table altered.
    SQL> create index t on t(id);
    Index created.
    SQL> create trigger t
      2  before update on t
      3  begin
      4     dbms_output.put_line('T Trigger');
      5  end;
      6  /
    Trigger created.but not:
    SQL> create view t as select * from t;
    create view t as select * from t
    ERROR at line 1:
    ORA-00955: name is already used by an existing objector
    SQL> create procedure t
      2  begin
      3     null;
      4  end;
      5  /
    create procedure t
    ERROR at line 1:
    ORA-00955: name is already used by an existing objectJohn

  • I recently updated my iPhone 5 with new ios 6.1 and i realize that my 3g is gone can u plz help me how to turn it back?

    i recently updated my iPhone 5 with new ios 6.1 and i realize that my 3g is gone can u plz help me how to turn it back?

    im using wifi, but before setting it was like ---> General--->Cellular---->Cellular Data on/off & 3g on/off. but now i cannot find 3g on/off its gone

  • I updated my iphone4 when i updated it require the previous owner of iclouds email and password but i didn't know him because i purchased it as second hand plz help me how i can rid from it :((((((((((((((((((((

    i updated my iphone4 when i updated it require the previous owner of iclouds email and password but i didn't know him because i purchased it as second hand plz help me how i can rid from it :((((((((((((((((((((

    Welcome to the Apple community Fazypk.
    Unfortunately, you cannot do very much with your phone unless you get assistance from the previous owner, they should either provide you with the password to unlock it or remove their account from the phone entirely remotely through iCloud.com > Find My Phone.

  • HT4623 i got apple iphone 3 and i getting problem to activate that its showing message could not activate plz help me how can i activate my phone?

    i got apple iphone 3 and i getting problem to activate that its showing message could not activate plz help me how can i activate my phone?

    Most likely your phone is carrier locked to a different carrier than the SIM card you're using.  It will activate and operate only with the carrier to which it's locked.

  • I have a defective iphone5 which is under guarantee,but unfortunately there isn't any apple retail store in my country.would you plz help me how can I change it?should I go to near country such as Dubai or Turkey to change it?

    I have a defective iphone5 which is under guarantee,but unfortunately there isn't any apple retail store in my country.would you plz help me how can I change it?should I go to near country such as Dubai or Turkey to change it?

    If the iPhone came from the US, then that is the only place where Apple will service it. If you can't take it there yourself, you would need to send the iPhone to someone you know in the US who could get it serviced and then send it back to you.
    Your only other option will be to find some unauthorized cellphone repair shop to attempt a repair, after which all further support from Apple, in the US or anywhere else, will no longer be available to you.
    Regards.

  • How to add two different page numbers in a single page

    How to add two different page numbers in a single page? One is for page number of the whole article, the other one is for page number for each chapter in the article.

    It's quite complicated, see
    Two Page Numbering Schemes in the Same Document.
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • How to call two different servlet-url in the same application

    Hi,
    I want to call, consecutively these methods in my application.
    response.sendRedirect(servlet-url1)
    reponse.sendRedirect(servlet-url2)
    but the second method dont answer,
    I think, the first method redirect s with response ,
    but how to call two different servlet ?
    thanks

    if you call the first redirect, the servlet is getting aborted, so you can redirect to the first servlet, working the stuff in it, and then in the second servlet you can redirect to the third servlet

  • HT4314 I have two ipods in my house that were set up under the same email.  I have since assigned two different emails.  How can I change the game center account so that is not shared by both ipods because it is for two different users and they are not ha

    I have two ipods in my house that were set up under the same email.  I have since assigned two different emails.  How can I change the game center account so that is not shared by both ipods because it is for two different users and they are not happy?

    By "game center account", do you mean Apple ID?
    If so, you can change it.
    1. Tap settings and navigate to iTunes and App Stores
    2. Tap "Apple ID" and then tap "Sign Out"
    3. Log in with a different ID.

  • I have "chatted" with customer service 5 different times. I was sent here. I have activated Photoshop Elements 9 on two different iMacs. They are both dead and I am unable to get it to activate on my newest computer. iMac. Can anybody help me?

    I have "chatted" with customer service 5 different times. I was sent here. I have activated Photoshop Elements 9 on two different iMacs. They are both dead and I am unable to get it to activate on my newest computer. iMac. Can anybody help me?

    Unfortunately, only adobe can help you with that, as most people here are just posters such as your self and don't work for adobe.
    If you go here and use the Chat now button (bottom of page), they should get you up and running by resetting your activations.
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html

  • Plz help.  How disable caching SQLJ statement  on WebLogic server 10.3?

    Plz help.
    How disable caching statement by SQLJ on WebLogic server?
    what the actual problem:
    1. create or replace view vtest as select object_name from dba_objects where rownum<200
    2. test.sqlj
      #sql dx testIterator = {
         select object_name from vtest
       int cnt=0;
       while( testIterator.next() ){
         cnt++;
       System.out.println("Count: "+cnt);
    3. Restart WebLogic and deploy project
    4. Run test on server, in log file
    "*Count: 199*"
    5. create or replace view vtest as select object_name from dba_objects where rownum<10
    6. Run test on server, in log file
    "*Count: 199*"
    7. Restart WebLogic
    8. Run test on server, in log file
    "*Count: 9*"

    Hi bud,
    Have you tried using WLST for what you are trying to achieve?
    Please take a look at the following links:
    http://docs.oracle.com/cd/E11035_01/wls100/config_scripting/domains.html
    http://docs.oracle.com/cd/E13222_01/wls/docs91/config_scripting/domains.html
    http://docs.oracle.com/cd/E13179_01/common/docs21/interm/config.html
    Hope this helps.
    Thanks,
    Cris

Maybe you are looking for

  • How do I get an adapter for a laptop and iPhone to use them in New Zealand and Australia?

    How do I gwet an adapter for a laptop and Iphone to use in New Zealand and Australia?

  • In CS6 how do I center text please!

    How do I print something in CS6 and for it to be centered on the page. I got the Ctrl+T  and I see the middle of the page, then pulled over the handle to center on the page but when I go to type on the center line...the type moves and all the text go

  • Change keyboard shortcuts for zoom

    Hi When looking at the keyboard shortcuts for MAC, the 100% zoom is down as command alt '0', yet it is showing in the dropdown list as 'n'? Is there a way of changing the shortcuts. Previously the 100% zoom was simply command (apple) '0', which is no

  • How to start /open  Jdeveloper?

    Hi I have just installed JDeveloper release 2 and I cannot start it up. In earlier versions I have run the jdevw.exe in the jdev/bin directory. I know this sounds dumb already , but can anyone help? thanks

  • Resolve xml namespace while importing xml schema

    Hi All, I am using ALSB 2.6 on windows platform. I have created a xml schema resource in a project folder. XML schema resource location is "/ANUP/TEST/SCHEMA". The target namespace for this schema is "http://test/schema/audit/properties.xsd". The XML