mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 13:04:05 -08:00
28 lines
621 B
Mathematica
28 lines
621 B
Mathematica
|
//
|
||
|
// TelResultParser.m
|
||
|
// ZXing
|
||
|
//
|
||
|
// Created by Christian Brunschen on 25/06/2008.
|
||
|
// Copyright 2008 Google Inc. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import "TelResultParser.h"
|
||
|
#import "TelParsedResult.h"
|
||
|
|
||
|
#define PREFIX @"tel:"
|
||
|
|
||
|
@implementation TelResultParser
|
||
|
|
||
|
+ (ParsedResult *)parsedResultForString:(NSString *)s {
|
||
|
NSRange telRange = [s rangeOfString:PREFIX options:NSCaseInsensitiveSearch];
|
||
|
if (telRange.location == 0) {
|
||
|
int restStart = telRange.location + telRange.length;
|
||
|
return [[[TelParsedResult alloc] initWithNumber:[s substringFromIndex:restStart]]
|
||
|
autorelease];
|
||
|
}
|
||
|
return nil;
|
||
|
}
|
||
|
|
||
|
|
||
|
@end
|