<!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. Allegro PCB Design GXL (legacy) 由零散的对象构成一个Shape

    Allegro PCB Design GXL (legacy) version 16.6-2015 从DXF文件中导入板框之后,发现板框是由Line Segment.Arc Segment等对象组成, ...

  2. WIN 7 使用shutdown命令设置电脑自动关机

    使用组合键“WIN + R”,在弹出的对话窗“运行”中输入“cmd”,点击“确定”按钮或直接按回车键“Enter”.  设置电脑在一定时间后关机,比如60分钟,在弹出的对话框中,输入“shutdown ...

  3. mac下Fiddler的安装-启动

    使用教程参考:http://www.cnblogs.com/TankXiao/archive/2012/02/06/2337728.html#request 环境安装 Mono安装 首先,Mac下需要 ...

  4. 复习reactnative....

    import React, { Component } from 'react'; import { AppRegistry, Text, Image, View, TextInput, Scroll ...

  5. javascript数组(五)

    一.创建数组.数组操作 数组是指的有序集合.每个值叫做元素,每个元素,每个元素在数组中都有梳子位置编号,也就是索引.JS中数组是弱类型的,数组中可以含有不同类型的元素.数组元素甚至可以是对象或其它数组 ...

  6. ajax后台输出有红点

    转自 百度了很多,说有utf8的bom头,通过dw,sublime软件,各种清除格式无果. 后来直接在返回结果之前,执行一下ob_clean(); 完美解决问题

  7. python之GIL release (I/O open(file) socket time.sleep)

    0.目录 2.线索 C源代码 Py_BEGIN_ALLOW_THREADS Py_END_ALLOW_THREADS3.open(name[, mode[, buffering]]) -> fi ...

  8. 基于Postman的API自动化测试

    https://segmentfault.com/a/1190000005055899 1. 安装 两种安装方式,我热衷于以chrome插件形式安装 Chrome插件 Mac App 2. 发送请求 ...

  9. JMeter实现登录初始化(类似LR的init函数功能实现)

    1.项目背景 在做项目的性能测试过程中,发现系统的登录功能非常慢,所以,在涉及到登录才能操作的场景,尽量避开登录操作 解决方案: 首选设置“登录并生成签名值”线程组

  10. day9.初始函数练习题

    1.写函数,检查获取传入列表或元组对象的所有奇数位索引对应的元素,并将其作为新列表返回给调用者. def new(args): a = [] for I in range(1,len(args),2) ...