ios - Check IF one String contains the same characters as another string -


I am trying to write a function which will allow me to determine whether a NSString * < As an example, type the following scenario:

  NSString * s1 = @ "going"; / code> characters of the second  NSString * ; NSString * s2 = @ "ievngcogdl";  

So basically, when there is a comparison between these 2 strings, then it should be correct because the first string of the first string s1 is the same letter S2 . Can I use a NSCountedSet ? I know that there is a method in this class Object in: (id) However I do not think it will solve my problem. I have other methods to complete this function and I need the necessary results See you?

I think this method is rather slow, but I still have the [NSString RangeOfCharacterFromSet:] , which requires a NSCharacterSet item per comparison:

  - (BOOL) string: (NSString * ) AllCharactersInString in String: (NSString *) Four String {NSUInteger stringLen = [String Length]; NSUntengar four string line = [four string length]; For (NSUntiger I = 0; I & lt; Fourstling Allen; I ++) {Unicure C = [Fourth Screen Character Atindex: I]; Bull got = no; (NSUntezer J = 0; J & LT; String Lane & amp; Found; J ++) found = [String CharteOutIndexX: J] == C; If (! Found) do not return; } Yes return; }  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -