zoukankan
html css js c++ java
JS如何读取文本的某一行?
问题:
比如文本里内容如下:
A
BB
CD
E
我想指定读这个文本的第三行,即CD,请问代码怎样实现?
回答:
用split把字符按“ ”分为数组,再读取第3项就行了。
JavaScript code
?
1
2
var
s =
"A BB CD E"
;
alert(s.split(
" "
)[2]);
查看全文
相关阅读:
【ZOJ3195】Design the City-LCA算法
【ZOJ3195】Design the City-LCA算法
【POJ1330】Nearest Common Ancestors-LCA算法
【POJ1330】Nearest Common Ancestors-LCA算法
【POJ3237】Tree-树链剖分
【POJ3237】Tree-树链剖分
【SPOJ375】Query on a tree-树链剖分
perl 回调必须是函数引用
运行复制的ZooKeeper 部署
运行复制的ZooKeeper 部署
原文地址:https://www.cnblogs.com/jscs/p/13444683.html
最新文章
go html ecmascript
Package template (html/template) ... Types HTML, JS, URL, and others from content.go can carry safe content that is exempted from escaping. ... (*Template) Funcs ..
9.5 自定义包和可见性 go mod
ECMAscript 没有对该方法进行标准化,因此反对使用它。 es 日期格式化
require
t
tmp
tmp
并发安全 sync.Map
csslint
热门文章
src/github.com/mongodb/mongo-go-driver/mongo/cursor.go 游标的简洁实用
r testifying that your code will behave as you intend.
bson
requests 中文乱码
js 数据获取
Create a /etc/yum.repos.d/mongodb-org-4.0.repo
LeastRecentlyUsed
【BZOJ1984】月下“毛景树”-树链剖分
【POJ2823】Sliding Window-单调队列
【POJ2823】Sliding Window-单调队列
Copyright © 2011-2022 走看看