Use of substring and substr in js, jssubstringsubstrUsage of substring and substr in js
Substring is a substring between two subscripts, and substr is a substring of the specified length starting from the specified position.
The first parameters of
From: http://www.cnitblog.com/yemoo/archive/2006/06/17/12421.html
Note:
1. Both s must be in lower case!
2. Method of the string object.
3. Index subscript starts from 0
4. Returns a string from start to end, but does not contain characters at the
First, let's look at two places that need to use substring:
1. in C #, we often need to reduce characters and use "... "To replace the reduced part, we usually use (string ). substring (), and then we can reduce it as follows:STR = (Str. length> 10
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "ABCABCBB" are "abc", which the length is 3. For "bbbbb" the longest substring are "B", with the
1 DOCTYPE HTML>2 HTMLLang= "en">3 Head>4 MetaCharSet= "UTF-8">5 title>Intercept the string one substringtitle>6 Head>7 Body>8 Script>9 /*the substring () method is used to extract the character of a string intermediary between two
Usage of substring in Javastr=str.substring (int beginindex), intercept str from the initial letter length of Beginindex string, the remaining string is assigned to STR;str=str.substring (int beginindex,int endIndex), intercepts the string from
How to use substring in Javastr=str.substring (int beginindex), intercept str from the initial letter length of Beginindex string, the remaining string is assigned to STR;str=str.substring (int beginindex,int endIndex), intercepts the string from
1.jquery data (name)The data () method attaches to the selected element or gets data from the selected element.$ ("#btn1"). Click (function() { $ ("div"). Data ("greeting", "Hello World");}); $ ("#btn2"). Click (function() { alert ("div"). Data
Question:
Ideas
Method 1: determine each substring of a string. If it is symmetric, obtain its length. This method is used to determine whether a substring is a substring from both ends to the middle. The total time complexity is O (n ^ 3 ),
The
Problem Description:Substring should be better understood, as to what is a subsequence, here is an example: there are two strings: Cnblogs belong such as sequence Bo, BG, LG in the parent string cnblogs and belong have appeared and the order of
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.