Dear haxians,
i must replace every \ in a string by \ and i have no idea how to do this. I feel very stupid.
Please help me!
thanks!
Dear haxians,
i must replace every \ in a string by \ and i have no idea how to do this. I feel very stupid.
Please help me!
thanks!
using StringTools;
string.replace("\\", "\\\\");
Hi Gama. Thanks for the fast reply.
That’s exactly what I was trying. But it didn’t work.
description = description.replace( '\\', '\\\\');
I’m using Haxe 4 RC3 and targeting JS
It works here : Try Haxe ! and I don’t see differences on higher Haxe versions in JavaScript target.
i found my mistake.There are some ‘\n’ and ‘\t’ in the string. I have to replace them seperately with ‘\n’ and ‘\t’
Thanks for help!
© 2018-2020 Haxe Foundation - Powered by Discourse