tags:

views:

32

answers:

1

Hi

I created array.plist file where I am storing key value pair e.g key = MY_FIRST_MESSAGE Value = Welcome\n I am happy to serve you.

in xml format Welcome\n I am happy to serve you.

I received this sting in dictionary and display in textview like below code textView.text = [myDict objectForKey:MY_FIRST_MESSAGE];

But I am not able to get newline. It should be look like below

Welcome I am happy to serve you

But I got it like Welcome\n I am happy to serve you

On textview view, I debug this problem, my got string from plist is like Welcome\n I am happy to serve you. Please suggest me how to remove \n from string which are from plist? I tried \n, \/n, /\n all combination.

Thanks Manu

+1  A: 

.plist files are XML, so you should be able to use an actual newline character rather than the string "\n".

Failing that:

string = [string stringByReplacingOccurrencesOfString:@"\\n" withString:@"\n"];
jnic