DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Fix Newline Characters Read In From XML

  • submit to reddit
        When you read an XML file that has newlines, Flash automatically strips them out. This fixes that. It's useful for displaying plain text in textfields.

private function fixXMLNewlines(str:String):String{
	var new_str:String = str.split("\\n").join("\n")
	return new_str