I have a NSString like this:
Hello
World
of
Twitter
Lets See this
>
I want to transform it to:
Hel
My case also contains \r, including \n, [NSCharacterSet newlineCharacterSet] does not work, instead, by using
htmlContent = [htmlContent stringByReplacingOccurrencesOfString:@"[\r\n]"
withString:@""
options:NSRegularExpressionSearch
range:NSMakeRange(0, htmlContent.length)];
solved my problem.
Btw, \\s will remove all white spaces, which is not expected.