<!doctype html>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>01 exam</title>
<link rel="stylesheet" type="text/css" href="01 exam.css">
</head>
<body> <h2>JavaScript String Methods</h2> <p>Replace "Microsoft" with "W3Schools" in the paragraph below:</p> <button onclick="myFunction()">Try it</button> <p id="demo">paul,paula,pauline,panl,paul</p> <script>
function myFunction() {
var str = document.getElementById("demo").innerHTML;
var txt = str.replace(/\bpaul\b/g,"Ringo");
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
</html>

string method and regular expresions的更多相关文章

  1. [Javascript] String method: endsWith() && startsWith()

    With endsWith && startsWith, you can easily find out whether the string ends or starts with ...

  2. LINQ to Entities does not recognize the method 'Int32 ToInt32(System.String)' method, and this method cannot be translated into a store expression

    if (!string.IsNullOrEmpty(FarmWorkId)) { data = data.Where(p => p.TypeId == Convert.ToInt32(FarmW ...

  3. LINQ to Entities does not recognize the method 'System.DateTime ToDateTime(System.String)' method

    System.Data.Objects.EntityFunctions和System.Data.Objects.SqlClient.SqlFunctions中的方法进行比较,如下 where Syst ...

  4. String Method的字符串变换的一个例子

    <!DOCTYPE html> <html lang="en"><head> <meta charset="UTF-8" ...

  5. python string method

    嗯,学习其它语言没这样全练过,嘻嘻 //test.py 1 # -*- coding: UTF-8 -*- 2 3 str = "i am worker" 4 print str. ...

  6. AttributeCollection.Add(String, String) Method

    <%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Trans ...

  7. string method 字符串常用方法讲解

    st = 'hello ketty ##$ \*'print(st.count('t'))# 输出‘t’的个数print(st.capitalize()) #Hello ketty 将首字母大写pri ...

  8. String.Join Method

    Overloads Join(String, String[], Int32, Int32) Concatenates the specified elements of a string array ...

  9. Regular Expressions --正则表达式官方教程

    http://docs.oracle.com/javase/tutorial/essential/regex/index.html This lesson explains how to use th ...

随机推荐

  1. mysql出现10060错误

    报错内容如下 Can't connect to MySQL server (10060) 提示不能连接 mysql服务. 首先检查任务管理器 看看mysqld.exe进程有没有启动.如果启动了就强制结 ...

  2. python文件操作r+,w+,a+,rb+,

    w:以写方式打开, a:以追加模式打开 (从 EOF 开始, 必要时创建新文件) r+:以读写模式打开 w+:以读写模式打开 (参见 w ) a+:以读写模式打开 (参见 a ) rb:以二进制读模式 ...

  3. 005-Python字典

    Python字典(dict) 字典是另一种可变容器模型,且可存储任意类型对象. 字典的每个键值(key=>value)对用冒号(:)分割,每个对之间用逗号(,)分割,整个字典包括在花括号{}中: ...

  4. .Net分布式锁

    项目中一般使用lock作为锁,以便于多线程操作确保库内数据统一.但是如果分布式部署项目,则这种锁就是去了意义,这时可以使用redis或memcache的add方法作为分布式锁. 栗子

  5. nginx-fastcgi 反向代理

    Nginx处理php页面 用fpm-server  基于fastcgi模块实现 Ngx_http_proxy_module  只能反代后端http server的主机 Ngx_fastcgi_prox ...

  6. 2018牛客网暑假ACM多校训练赛(第四场)B Interval Revisited 动态规划

    原文链接https://www.cnblogs.com/zhouzhendong/p/NowCoder-2018-Summer-Round4-B.html 题目传送门 - https://www.no ...

  7. AtCoder Regular Contest 082 (ARC082) E - ConvexScore 计算几何 计数

    原文链接http://www.cnblogs.com/zhouzhendong/p/8934254.html 题目传送门 - ARC082 E 题意 给定二维平面上的$n$个点,定义全集为那$n$个点 ...

  8. Ubuntu16.04多个版本GCC编译器的安装和切换

    这几天在配置交叉编译ARM开发板的linux内核的过程中碰到了很多问题,其中包括了GCC版本太高等问题,由此我打算安装其他老的版本给我的Ubuntu16.04.实验过程如下: 官网的教程是最牛逼的,先 ...

  9. bootstrapTable

    一个详细的教程 table参数 bootstrap table使用总结 BootstrapTable使用实例 事件event 事件函数的用法: 方法1 $('#table').bootstrapTab ...

  10. oracle中date数据的转换问题

    (TO_NUMBER(TO_CHAR(FP.KPRQ, 'HH24')) >= 18 kprq >= to_DATE ('2017-01-12 18:00:00','yyyy-MM-dd ...