BrainDrain Posted January 28, 2007 Share Posted January 28, 2007 (edited) A process included in my application uses Results in a string, which sometimes needs to include the '&' symbol. I know replacing '_ ' with '&&' would get it, however is there a way to handle the string where it doesn't amperand the character?This is really hard to explain... basically is there a method to safely detect '&' characters in a string and replace them with '&&', or prevent them from becoming amperanded at all?An example of an unsuccessfull call would be:Save a text file containing the contents '& ' as C:\test.txtIn Delphi place a memo and button on the form, Memo1 and Button1 respectivelyButton1.click:begin Memo1.loadfromfile('C:\test.txt'); showmessage(Memo1.lines[0]);endWhere it would show '_' in the showmessage. Edited January 29, 2007 by BrainDrain Link to comment Share on other sites More sharing options...
BrainDrain Posted February 2, 2007 Author Share Posted February 2, 2007 Eech, I should have done a bit more trialing, replacing '&' with 'and' works (well enough)... it seems the character is handled as & until its painted on the form... Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now