JavaScript Replace 多个字符
JavaScript字符 多个 replace
2023-09-14 08:58:39 时间
<html> <head> <title></title> <script language="javascript"> function test() { var str = "^XA^JMA^XZ ^XA ^MMT ^LL0094 ^PW354 ^LS0 ^BY2,3,30^FT21,45^BCN,,N,N ^FD>:{SN}^FS ^FT21,67^A0N,25,24^FH\^FD{SN}^FS ^PQ1,0,1,Y^XZ "; var ss=str.replace(/{SN}/g,"1111111"); alert(ss); } </script> </head> <body> <input type="button" value="test" id="btntest" onclick="test()" /> </body> </html>
相关文章
- 【JavaScript 6连载】五、继承的概念
- JavaScript中统计字符的个数
- 请用charAt获取javascript获取字符串指定位置字符
- Javascript Prototypes之旅(A Plain English Guide to JavaScript Prototypes译文)
- javascript中slipt()分割
- [Javascript] Build lodash.debounce from Scratch
- [Javascript] Data ownership, avoid accidently mutation
- [Javascript] Wait for the Fastest JavaScript Promise to Be Fulfilled with Promise.any()
- [Javascript] JavaScript赋值时的传值与传址
- [Javascript] Delegate JavaScript (ES6) generator iteration control
- [Javascript] Iterate Over Items with JavaScript's for-of Loop
- [Javascript] Identify and Deal with NaN in JavaScript
- [Javascript] Decorators in JavaScript
- [Javascript] Proper use of console.assert in JavaScript
- [Javascript] JavaScript Array Methods in Depth - push
- [Javascript] Prototype, hasOwnProperty(), valueOf() and toString() methods.
- javascript中var、let、const的区别
- [Javascript] Create an Image with JavaScript Using Fetch and URL.createObjectURL
- [Javascript] An Introduction to JSPM (JavaScript Package Manager)
- 学习Javascript闭包(Closure)
- Maven build中隐藏的SAP UI5 JavaScript merge任务
- ABAP,Java,JavaScript里的字符串模板String Template
- 介绍一种在ABAP内核态进行内表高效拷贝的方法,和对应的Java和JavaScript版本的伪实现
- JavaScript与有限状态机
- new:dhtmlx Event Calendar JavaScript 1.0 Crack
- DataGridXL 2.0 for JavaScript Crack
- JavaScript-保留两位小数
- A Simple Example About Privileged Methods in JavaScript
- web前端Javascript开发学习之JavaScript中的预编译如何进行
- web前端Javascript学习之了解JavaScript弹出框
- javascript怎么判断字符串中全为f?
- JavaScript 函数和事件
- JavaScript从入门到精通(第二版) 核心知识总结
- web前端框架Javascript开发基础之JavaScript作用域