<!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. flower

    问题 D: flower 时间限制: 1 Sec  内存限制: 128 MB 题目描述 又是一年教师节,有n个小朋友打算去看望花老师.去看花老师当然要买花咯,不过某些土(xue)豪(ba)买了太多的花 ...

  2. Nginx详解二十一:Nginx深度学习篇之配置苹果要求的openssl后台HTTPS服务

    配置苹果要求的证书: 1.服务器所有的连接使用TLS1.2以上的版本(openssl 1.0.2) 2.HTTPS证书必须使用SHA256以上哈希算法签名 3.HTTPS证书必须使用RSA2048位或 ...

  3. C++ 关闭显示器

    好困,想躺一下,关灯.上床,笔记本的屏幕还亮着,好刺眼,睡不着! 脑子里出现一个疑问,怎么用C++写一个关闭屏幕的小程序呢? 参考了网上已有的例子,最简化: #include <windows. ...

  4. Appium Python API 中文版

    Appium_Python_Api文档 1.contextscontexts(self): Returns the contexts within the current session. 返回当前会 ...

  5. Windows批处理命令用法

    阅读下面文字需要一定的dos基础概念,象:盘符.文件.目录(文件夹).子目录.根目录.当前目录 每个命令的完整说明请加 /? 参数参考微软的帮助文档可以看到,在 /? 帮助里,"命令扩展名& ...

  6. git 小乌龟安装教程

    一.windows系统安装git 首先下载git for windows客户端http://msysgit.github.io/ 安装过程没什么特别的,不停next就ok了     图太多就不继续了~ ...

  7. servlet获取多个同名参数

    String[] item = request.getParameterValues("参数名");

  8. 網管利器!開源管理系統-LibreNMS

    https://www.4rbj4.com/442 https://www.ichiayi.com/wiki/tech/librenms

  9. Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法

    发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站  小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...

  10. [转] 2016 JavaScript 发展现状大调查

    有人认为JavaScript是最好的语言,有人认为它一团糟.可按照C++之父的话来讲: 世界上只有两种编程语言:一种是天天被人喷的,另一种是没人用的. 不论你喜欢承认与否,JavaScript已经一天 ...