Microsoft address
Indexof () method of list
If t is of the value type, match the first element of the list one by one based on the comparison value method. If t is of the reference type, compare whether the reference is the same.
Example:
1.indexof methodThe IndexOf () method returns the position of the first occurrence of a specified string value in a string.Grammar:Note: There are optional parameters (that is, the location where the settings begin).2. Search methodThe search ()
Returns the character position for the first occurrence of a substring within a string object.
Strobj.indexof (substring[, StartIndex])
Parameters
Strobj
Required option. A String object or text.
SubString
Required option. The substring to find in
Definition and usageThe IndexOf () method returns the position of the first occurrence of a specified string value in a string.GrammarStringobject.indexof (Searchvalue,fromindex)
Parameters
Describe
Searchvalue
Self-summary, what needs to be corrected to make up for the place, please point out, grateful!This paper summarizes the usage of indexof ,bigdecimal multiplication, shift operation ,formatted output of decimal, string substitutionOn the code:Test
1.substrSUBSTR (Start,length) is a string that starts at the start position and intercepts length lengths.var src= "Images/off_1.png";Alert (SRC.SUBSTR (7,3));The popup value is: Off2.substringSUBSTRING (start,end) represents a string from start to
The IndexOf () method returns the location of the first occurrence of a specified string value in a string.
Grammar
Stringobject.indexof (Searchvalue,fromindex)
Parameter description
Searchvalue required. A string value that requires
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Run the above code, you can.
If you want to see how JavaScript indexof is used, see the following article
JavaScript indexof Function Usage
The usage of substr,substring,indexof,lastindexof in JS
1.substrSUBSTR (start,length) indicates that the length of a string is intercepted from the start position.
var src= "Images/off_1.png";Alert (SRC.SUBSTR (7,3));
The pop-up value is: off
The ECMASCRIPT5 standard, published on December 3, 2009, brings a number of new ways to improve the operations of existing array arrays. However, these novel array methods are not really popular because of the lack of browsers supporting ES5.
Array
Similar indexof usage _instr functions in Oracle[SQL] does not have a indexof () function in Oracle but provides a InStr () method for specific usage: Select InStr (' Baoding Nanshi District ', ' City ', ' 1 ')-from dual; Explanation: 1. ' Baoding
# Find is similar to indexof in Java, returning to the location found and not finding the return-1target='www.163.com'print( Target.find ('163'))if target.find ('263 ') ==-1: print('263 does not exist in string '+target+' ) ') "Pyhon" string
var array=[' REG ', ' 2018 ', ' 2018 ';Array.indexof (' REG ')//0Array.indexof (' R ')//-1Array.indexof (' 2018′)//1Array.indexof (2018)//-1
Arr.indexof (' orange ') output 0 because ' orange ' is the No. 0 element of the array, matches to and
Change them all to uppercase or lowercase, and compare them.
IndexOf the character position of the substring for the first time within the object
With toLowerCase or toUpperCase
[Ctrl + A All SELECT Note: If the need to
Similar to indexof in oracle, The _ instr function [SQL] does not have the indexof () function in oracle, but an instr () method is provided. Specific usage: select instr ('baoding nanchengqu ', 'city',)-1 from dual; Explanation: 1. 'baoding city
var array = [23,48,66,2]; ForEach: Loops, iterates through an array, no return value. Similar to For Loop Array.foreach (function (value, index, array) { console.log (value); return value * value;}); Map : The map means that the map returns a new
Problem DescriptionA piece of flower cloth, there are some patterns, there is a directly available small bar, there are some patterns. For a given strip of flowers and strips, calculate how many pieces of strips can be cut from the flower
C # binary byte stream lookup function indexof
///Report specified system.byte[] The index of the first occurrence in this instance. // performed find system.byte[]. // system.byte[to find]. /// If the byte array is found, the index
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.