I have a text box and I want to replace "\ n" with "," in it with a value.
var valuetxtarr = $("#txtarr").val(); var valuetxtarrs = valuetxtarr.replace("/\n/g",","); alert(valuetxtarrs);
But that doesn't work? Why? Where am I mistaken?
You just need to remove the quotes (otherwise it searches for this string), for example:
var valuetxtarr = $("#txtarr").val(); var valuetxtarrs = valuetxtarr.replace(/\n/g,","); alert(valuetxtarrs);â
You can try here
var valuetxtarr = $("#txtarr").val(); var valuetxtarrs = valuetxtarr.replace(/\n/g,","); alert(valuetxtarrs);
Source: https://habr.com/ru/post/1314316/More articles:How to make these foreach loops efficient? - c #LINQ-to-SQL performance issue for bulk inserts - c #How to use item versioning in an EHCache instance? - javaAre there any cases where LINQ.Where () will be faster than O (N)? - performanceCan SVG contain both absolute and relative commands? - pathDoes enumeration for entire operations with bit orientation in C ++ use reliable / safe? - c ++Entity service behavior - how to avoid injecting services into an entity? - c #Can I choose from several tables that have their own names as a result of a subquery? - sqlAsync = true and Entity Framework - sql-server-2005Updating the database schema at run time with the Entity Framework - databaseAll Articles