fork(1) download
  1. #import <Foundation/Foundation.h>
  2.  
  3. int main() {
  4. NSAutoreleasePool *pool = [NSAutoreleasePool new];
  5. NSString *car = @"Porsche Boxster";
  6. if ([car isEqualToString:@"Porsche Boxster"]) {
  7. NSLog(@"El carro es un Porsche Boxster");
  8. }
  9. if ([car hasPrefix:@"Porsche"]) {
  10. NSLog(@"El carro comienza con Porsche");
  11. }
  12. if ([car hasSuffix:@"Carrera"]) {
  13. NSLog(@"El carro termina en Carrera");
  14. }
  15. [pool drain];
  16. return 0;
  17. }
  18.  
  19.  
Success #stdin #stdout #stderr 0.03s 42824KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
2016-05-01 20:16:30.822 prog[30165] El carro es un Porsche Boxster
2016-05-01 20:16:30.823 prog[30165] El carro comienza con Porsche