i have seen this block of code in this Stackoverflow as a answer of some ones question,i tried to impliment that in my code but i am not getting what kind of function is this and how can i call that
NSString * ReplaceFirstNewLine(NSString * original)
{
NSMutableString * newString = [NSMutableString stringWithString:original];
NSRange foundRange = [original rangeOfString:@"\n"];
if (foundRange.location != NSNotFound)
{
[newString replaceCharactersInRange:foundRange
withString:@""];
}
NSLog(@"%@",newString);
return [[newString retain] autorelease];
}
i have tried to call this like [self ReplaceFirstNewLine(@"\nstirng\nstring")];
but its giving syntax error,can any one help me out