User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







objective-c:foundation.framework:nsstring.h:isequaltostring

isEqualToString

   - (BOOL)isEqualToString:(NSString *)aString;   

Returns a Boolean value that indicates whether a given string is equal to the receiver using an literal Unicode-based comparison.

ObjC Sourcecode Example

    NSString *myString1=@"Hello World";
    NSString *myString2=@"Hello World";
 
        if([myString1 isEqualToString:myString2]){
 
            NSLog(@"similar");
        }
        else{
 
            NSLog(@"dissimilar");
        }
 
         //  it returns a boolean, a special int
        NSLog(@"%i", [myString1 isEqualToString:myString2]);
 

Output for this example code

2012-04-15 12:47:04.266 FoundationNSString[719:403] similar
2012-04-15 12:47:04.269 FoundationNSString[719:403] 1

on the occasion of the current invasion of Russia in Ukraine

Russian Stop this War
objective-c/foundation.framework/nsstring.h/isequaltostring.txt · Last modified: 2024/02/16 01:12 (external edit)

Impressum Datenschutz