
#import "NSString+Substrings.h"

@implementation NSString (MiscSubstrings)

// This method donated by Aleksey Sudakov
- (NSString *)substringToString:(NSString *)aString
{
        NSRange range = [self rangeOfString:aString];
        return [self substringToIndex:range.location];
}

// This method donated by Aleksey Sudakov
- (NSString *)substringFromString:(NSString *)aString
{
        NSRange range = [self rangeOfString:aString];
        return [self substringFromIndex:range.location];
}

// This method donated by Aleksey Sudakov
- (NSString *)substringFromEndOfString:(NSString *)aString
{
        NSRange range = [self rangeOfString:aString];
        return [self substringFromIndex:range.location + range.length];
}

@end
