I have a issue in omitting \r\n after encoding the string, below is the encoded string which I have got,
QzAxODBCMDQtNDdDMi00QzhDLTg1MTAtNUE1MzU1RDIzRDA4Ojk4Mzg5MzRkYzky\r\nNTRkYWE4ODljY2Q0ZGYxNjljYTU
I have a issue in omitting \r\n after encoding the string, below is the encoded string which I have got,
QzAxODBCMDQtNDdDMi00QzhDLTg1MTAtNUE1MzU1RDIzRDA4Ojk4Mzg5MzRkYzky\r\nNTRkYWE4ODljY2Q0ZGYxNjljYTU
You can easily remove the \r\n
from a string like this:
NSString *outString = [inString stringByReplacingOccurrencesOfString:@"\r\n" withString:@""];
If you want to create the strings without \r\n
in the first place, then it depends on how you create them. For example, if you're using the Base64 category from Cocoa with Love, you need to add this line before the call to BIO_write
in base64EncodedString
:
BIO_set_flags(context, BIO_FLAGS_BASE64_NO_NL);
He explains this in the article.