C# hexadecimal value 0x12, is an invalid character

I made a small research here. Here is the ASCII table. There are 128 symbols Here is some small test code which adds every symbol from ASCII table and tries to load it as an XML document. static public void RegexTry() { StreamReader stream = new StreamReader(@”test.xml”); string xmlfile = stream.ReadToEnd(); stream.Close(); string text = … Read more

Java Replace Line In Text File

At the bottom, I have a general solution to replace lines in a file. But first, here is the answer to the specific question at hand. Helper function: public static void replaceSelected(String replaceWith, String type) { try { // input the file content to the StringBuffer “input” BufferedReader file = new BufferedReader(new FileReader(“notes.txt”)); StringBuffer inputBuffer … Read more

How to replace placeholder character or word in variable with value from another variable in Bash?

Bash can do string replacement by itself: template=”my*appserver” server=”live” template=”${template/\*/$server}” See the advanced bash scripting guide for more details on string replacement. So for a bash function: function string_replace { echo “${1/\*/$2}” } And to use: template=$(string_replace “$template” “$server”)