mirror of
https://github.com/gnustep/libs-steptalk.git
synced 2025-02-21 18:50:54 +00:00
Added NSString additions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/steptalk/trunk@16696 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4382f14ae4
commit
e6f949cf2a
2 changed files with 71 additions and 0 deletions
32
Languages/Smalltalk/NSString+additions.h
Normal file
32
Languages/Smalltalk/NSString+additions.h
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
/**
|
||||||
|
NSString-additions.h
|
||||||
|
Various methods for NSString
|
||||||
|
|
||||||
|
Copyright (c) 2002 Free Software Foundation
|
||||||
|
|
||||||
|
Date: 2003 May 9
|
||||||
|
Author: Stefan Urbanek <urbanek@host.sk>
|
||||||
|
|
||||||
|
This file is part of the StepTalk project.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/NSString.h>
|
||||||
|
|
||||||
|
@interface NSString (STSmalltalkAdditions)
|
||||||
|
- (BOOL)containsString:(NSString *)aString;
|
||||||
|
@end
|
39
Languages/Smalltalk/NSString+additions.m
Normal file
39
Languages/Smalltalk/NSString+additions.m
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
/**
|
||||||
|
NSString-additions.h
|
||||||
|
Various methods for NSString
|
||||||
|
|
||||||
|
Copyright (c) 2002 Free Software Foundation
|
||||||
|
|
||||||
|
Date: 2003 May 9
|
||||||
|
Author: Stefan Urbanek <urbanek@host.sk>
|
||||||
|
|
||||||
|
This file is part of the StepTalk project.
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Lesser General Public
|
||||||
|
License as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
This library is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
Lesser General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public
|
||||||
|
License along with this library; if not, write to the Free Software
|
||||||
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import "NSString+additions.h"
|
||||||
|
|
||||||
|
@implementation NSString (STSmalltalkAdditions)
|
||||||
|
- (BOOL)containsString:(NSString *)aString
|
||||||
|
{
|
||||||
|
NSRange range;
|
||||||
|
|
||||||
|
range = [self rangeOfString:aString];
|
||||||
|
|
||||||
|
return (range.location != NSNotFound);
|
||||||
|
}
|
||||||
|
@end
|
Loading…
Reference in a new issue