Using \n in stringdict file [duplicate] - swift

This question already has answers here:
NSString: newline escape in plist
(5 answers)
Closed 1 year ago.
I m using stringdict file for pluralization in iOS. I need to use the \n for the new line but If I use \n in stringdict file it's not showing the text in the new file. How can I use \n for the new line?

Verified Solution:
The stringsdict file allows you to jump to a new line using the key combination (option + enter)

Related

How to delete from a text file, all lines that DO NOT contain a specific string? [duplicate]

This question already has answers here:
sed delete lines not containing specific string
(4 answers)
Remove all lines except matching pattern line best practice (sed)
(4 answers)
Closed 17 days ago.
How would I use sed to delete all lines in a text file which do not contain a specific string?
sed '/pattern to match/d' ./infile
I used this command, but it deletes the lines MATCHING a specific pattern,
but what I want is to delete the lines which DO NOT contain a specific pttern?

Save as text File without brackets in Spark and change delimiter between the types [duplicate]

This question already has answers here:
How to remove parentheses around records when saveAsTextFile on RDD[(String, Int)]?
(6 answers)
Closed 7 years ago.
When I save this RDD[(String,Double)] as a text file I get:
(Ram is great,1.0)
Can I save into file without these brackets and also can we change this comma and put some other delimiter like tab (\t).
Hence it will look like:
Ram is great 1.0
Map the RDD to a string with the formatting you prefer.
Something like coll.map(x=>s"${x._1}\t${x._2}").saveAsTextFile(file)
It will be like this ->
Suppose RDD name is temp
val required = temp.map(f => f._1+"\t"+f._2).saveAsTextFile(path)

How to eregi_replace to preg_replace [duplicate]

This question already has answers here:
How can I convert ereg expressions to preg in PHP?
(4 answers)
Closed 8 years ago.
eregi_replace('[0-9]+\.+[0-9]','',$cart['unit']);
How to change it to preg_replace?
I get an error: Warning: preg_replace() [function.preg-replace]: Unknown modifier '+' in ---
You can use your existing Regex almost unchanged in a preg_replace(). Just add delimiters and a case-insensitive modifier. You get
preg_replace('#[0-9]+\.+[0-9]#i','',$cart['unit']);
In fact, the case-sensitivity is irrelevant since your pattern only matches 0-9 and .

iPhone: how to append to end of text file? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
iOS - appending to end of file with NSMutableString
Say I have a file at /var/mobile/Documents/myfile.txt
And that file contains
Text
Some more text
How can I append
Even more text
to the end of that file?
Read the content of the file in NSMutableData.
convert the appended text to bytes and append the bytes to NSMutableData then write the NSMutableData to File

How to put \n into string in plist [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
NSString: newline escape in plist
I have a plist with a string, and I want to get line breaks.
Putting \n\n doesn't work.
Is there any other way to do this?
Thanks
already answered here:
NSString: newline escape in plist