SUBSTRING (c#,java,javascript,sqlserver) Usage Summary

Source: Internet
Author: User

C#:

SUBSTRING (first parameter, second parameter)//first parameter: Starting from the beginning of the section, the initial is starting from 0 bits the second parameter: Intercept several

SUBSTRING (parameter) if the incoming parameter is a long integer, and is greater than or equal to 0, the long position is the starting point and all remaining as strings are truncated. If the incoming value is less than 0, the system throws an argumentOutOfRange exception indicating that the parameter range is out of bounds.

Java:

SUBSTRING (parameter) is a method of intercepting a string in Java with two ways of communicating

One is the public string substring (int beginindex) that returns a new string, which is a substring of this string. The substring starts at the character at the specified index until the end of the string.

The other is the public string substring (int beginindex, int endIndex) returns a new string that is a substring of this string. The substring starts at the specified beginindex until the character at index EndIndex-1. Therefore, the length of the substring is endindex-beginindex.

Javascript:

Stringobject.substring (Start,stop)

Start Required. A nonnegative integer that specifies the position of the first character of the substring to be extracted in the stringobject. Starting position var str= "1234567890"; Str.substring ("2"); Output: 34567890

Stop is optional. A nonnegative integer that is 1 more than the last character of the substring to extract in Stringobject. If this argument is omitted, the returned substring continues until the end of the string.

Stringobject.substr (Start,length)

Start Required. The starting subscript for the substring to extract. Must be numeric. If it is a negative number, the argument declares the position from the end of the string. That is,-1 refers to the last character in the string, 2 refers to the second-lowest character, and so on.

Length is optional. The number of characters in the substring. Must be numeric. If this argument is omitted, then the string from the beginning of the stringobject to the end is returned.

Sql server:

SUBSTRING (expression, start, length)

An expression string, binary string, text, image, column, or expressions that contain columns. Do not use an expression that contains an aggregate function.

Start integer or an expression that can be implicitly converted to int, specifying the starting position of the substring.

Length integer or an expression that can be implicitly converted to int, specifying the length of the substring (however, the result does not necessarily return a length character, to see the length of the expression and the setting of start!!!!!!!!!!! )。

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.