DXL - Unexpected character output -


i'm writing function replace substrings (what laguange doesn't have this, grr), , getting strange characters in ouput. cannot figure out why.

string replacesubstring(string input, string targetsubstring, string substitute, bool matchcase) {     string result = input     buffer b = create     b = input     int targetstartpos     int targetlength      while (findplaintext(result, targetsubstring, targetstartpos, targetlength, matchcase))     {         string prefixstr = b[0:targetstartpos - 1]         string suffixstr = b[targetstartpos + targetlength:]          b = prefixstr substitute suffixstr         result = tempstringof(b)     }      delete b     return result } 

when running print replacesubstring("jake lewis", "ake", "ack", false), output of �*��*�is. appear sort of encoding issue, unclear on how happening, or how fix it.

try using stringof() instead of tempstringof(). processing fine, result becomes invalid after deleting b.


Comments

Popular posts from this blog

php - Embed BBCode within itself not working -

three.js - how to load gltf in three JS -

sql server - T-SQL: Access DB objects in same schema without qualifying? -