Wednesday, June 30, 2010

Replacing Characters in String Literals for XML Files

In XML there are certain ASCII characters in literal strings you can not use such as quotes (single and double), ampersands, and a couple others. To replace Characters in String Literals to put into XML use the following segments.


Item = "R:\Sample & Path\test\am's this code is full of & stuff's"
string temp = Item;
temp = temp.Replace("&", "&");
temp = temp.Replace("'", "'");
sr.WriteLine("");



No comments:

Post a Comment

Generating "Always On Top" NSWindow in macOS across all detected displays

Also: Using UIKit & Cocoa Frameworks using Objective-C In m acOS or OS X , written in either Objective-C or Swift  Langues, you m...