<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
font-family: "Microsoft YaHei", serif;
} body, dl, dd, p, h1, h2, h3, h4, h5, h6 {
margin: 0;
} ol, ul, li {
margin: 0;
padding: 0;
list-style: none;
} img {
border: none
}
</style>
</head>
<body> <script> let a = "abc张宇1234567"; let b = a.substring(3,5); //如果写了负数会认为是0,这个可以5,3 console.log(b); let c = a.slice(-5,-2); //这个可以是负数,这个不可以5,3
console.log(c); </script>
</body>
</html>

21-2-substring的更多相关文章

  1. 使用ICSharpZipLib将文件夹压缩为zip文件

    序言:     在我接触Git和SVN之前,我最常用的保存数据的办法就是把文件夹压缩成一个zip文件,添加上时间戳.下面是我在学习C#的文件操作之后做的一个练习,使用开源的ICSharpZipLib来 ...

  2. 木马APP的简单分析(Android Killer分析)

    本文作者:三星s7edge 一.此贴目的:分析一个木马APP样本的行为.—————————————————————————————————————————————————-二.分析步骤及结果: 文件名 ...

  3. T_SQL 字符串函数

    字符串函数用于处理列中的数据值,通常属于字符型的数据类型. 1.ASCLL(character),将具体字符转换为相应的整数(ASCII)代码,结果为正数. 例:select  ASCII('A'), ...

  4. 全套Java教程_Java基础入门教程,零基础小白自学Java必备教程 #011 # 第十一单元 String&ArrayList #

    一.本单元知识点概述 (Ⅰ)知识点概述 二.本单元教学目标 (Ⅰ)重点知识目标 1.ArrayList集合的常用方法2.ArrayList存储数据和遍历数据3.String类的构造方法4.String ...

  5. WebKit Inside: DOM树的构建

    当客户端App主进程创建WKWebView对象时,会创建另外两个子进程:渲染进程与网络进程.主进程WKWebView发起请求时,先将请求转发给渲染进程,渲染进程再转发给网络进程,网络进程请求服务器.如 ...

  6. 2016/9/21 leetcode 解题笔记 395.Longest Substring with At Least K Repeating Characters

    Find the length of the longest substring T of a given string (consists of lowercase letters only) su ...

  7. 21.Longest Palindromic Substring(最长回文子串)

    Level:   Medium 题目描述: Given a string s, find the longest palindromic substring in s. You may assume ...

  8. 最长回文子串-LeetCode 5 Longest Palindromic Substring

    题目描述 Given a string S, find the longest palindromic substring in S. You may assume that the maximum ...

  9. POJ3693 Maximum repetition substring [后缀数组 ST表]

    Maximum repetition substring Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9458   Acc ...

  10. [译+改]最长回文子串(Longest Palindromic Substring) Part II

    [译+改]最长回文子串(Longest Palindromic Substring) Part II 原文链接在http://leetcode.com/2011/11/longest-palindro ...

随机推荐

  1. Python 工匠

    https://github.com/piglei/one-python-craftsman/blob/master/zh_CN/7-two-tips-on-loop-writing.md

  2. prototype.原型链.原型链图

      //1.几乎所有函数都有prototype属性,这个是个指针,指向原型对象;Function.prototype这个没有 //2.所有对象中都有__proto__属性.(Object.protot ...

  3. 1. Python版本的选择与安装

    Python综述 Python由Guido van Rossum于1989年底发明,第一个公开发行版发行于1991年.Python是一种解释型.面向对象.动态数据类型的高级程序设计语言,它具有卓越的通 ...

  4. 17、通过maven生成测试报告

    目录如下: 通过Maven 生成报告 进入testngTest根目录,运行mvn test 命令 进入 testngTest\target\surefire-reports 路径查看测试报告

  5. Git 学习第一天

    本文是根据廖雪峰老师的git教程记录的学习笔记,特此说明,原教程链接https://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c ...

  6. certbot免费证书

    yum install python-certbot-nginx 开启防火墙443端口 firewall-cmd --add-port=443/tcp --permanent 别忘了重启 firewa ...

  7. codeforces1175E Minimal Segment Cover 倍增

    题目传送门 题意:给出n条平行于x轴的线段,q次询问,每次询问一个区间最少要几条线段来覆盖,若不能覆盖则输出-1. 思路:先考虑贪心,必定是先找到,所有左端点小于等于$x$的线段的右端点最大在哪里,然 ...

  8. EF批量添加数据之修改SQL Server执行上限

    asp.net core 项目 打开Startup.cs services.AddDbContext<MyContext>( options => { options.UseSqlS ...

  9. jQuery - 动画相关

    // 显示隐藏 $("div").show(); // 显示 $("div").hide(); // 隐藏 // 显示过程3秒, 3秒之内, 元素的宽,高和透明 ...

  10. JUC 一 CyclicBarrier 与 Semaphore

    java.util.concurrent CyclicBarrier简介 CyclicBarrier:可重用屏障/栅栏 类似于 CountDownLatch(倒计数闭锁),它能阻塞一组线程直到某个事件 ...