I wrote this in javascript already, but ide like to put it in my program also, so how would i do this in c++. Find a certain group of characters and replace it with another.
Code:<html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <SCRIPT LANGUAGE="JavaScript"> function replaceChars(entry) { out = "."; // replace this add = "/n"; // with this temp = "" + entry; // temporary holder while (temp.indexOf(out)>-1) { pos= temp.indexOf(out); temp = "" + (temp.substring(0, pos) + add + temp.substring((pos + out.length), temp.length)); } document.subform.text.value = temp; } </script> </head> <body> <center> <form name="subform"> <textarea name="text" cols="85" rows="40" wrap="VIRTUAL">Enter Text Here</textarea> <br> <input type=button name=action value="Finish" onClick="replaceChars(document.subform.text.value);"> </form> </center> </body> </html>



LinkBack URL
About LinkBacks


