answersLogoWhite

0

The substring method returns

Updated: 10/24/2022
User Avatar

Wiki User

15y ago

Best Answer

"[Substr] returns a string object with its contents initialized to a substring of the current object."

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: The substring method returns
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What method returns the uppercase equivalent of a string?

The toUpperCase() method returns the uppercase equivalent of a string.


How do you show the location of an occurrence of the letter e in a string using javascript?

The location of a substring within a string in JavaScript can be found using the indexOf() method of the string type. That method will return the placement of a string as a numerical index, starting from 0. The method takes two arguments. The first is the substring you're looking for. In this case "e." The second argument is optional, and it's the "start" argument. If you define it, you define the index from which JavaScript will start looking for the substring. By default, this index is 0 (zero.) If you want to find all of the occurrences of a string using this method, you have to write a loop. To see a working example of that, check out the JSFiddle in the related links. I've also attached a good lesson on JavaScript strings in PDF.


How do you use indexOf in java?

indexOf is a method of the String class. Since the indexOf method is overloaded, I will be using the indexOf(String str) version in this example. According to the API Documentation, this method "Returns the index within this string of the first occurrence of the specified substring." So, if you wanted to find the position of the letter 'v' in the String 'Java' and print it out, you would do this: String str = "Java"; int i = str.indexOf("v"); System.out.println(i); If the character you passed in the indexOf method does not exist in the String, indexOf would return a -1 (negative one).


How do you use sub string in java?

Substring method creates smaller string form bigger string , every time a new string is created but original character array buffer is used. so even if original string is 1G in size and substring is just 1K memory held by substring is 1G because of backed array. this can cause memory leak and prevent original string from garbage collection even if there is no direct reference.


What value is return by int main method?

1. A method declared as "int" returns an int value. 2. The main() method in Java is not declared as "int", but as "void", meaning it returns no value.

Related questions

What is th function of the charindex?

The CHARINDEX function in SQL is used to find the position of a specific character or substring within a string. It returns the starting position of the substring or character within the given string.


Write a Java Program to find occurences of given word in a text?

Check the documentation of the String class, for a method that searches for a substring.


What method returns the uppercase equivalent of a string?

The toUpperCase() method returns the uppercase equivalent of a string.


How do you show the location of an occurrence of the letter e in a string using javascript?

The location of a substring within a string in JavaScript can be found using the indexOf() method of the string type. That method will return the placement of a string as a numerical index, starting from 0. The method takes two arguments. The first is the substring you're looking for. In this case "e." The second argument is optional, and it's the "start" argument. If you define it, you define the index from which JavaScript will start looking for the substring. By default, this index is 0 (zero.) If you want to find all of the occurrences of a string using this method, you have to write a loop. To see a working example of that, check out the JSFiddle in the related links. I've also attached a good lesson on JavaScript strings in PDF.


How do you use indexOf in java?

indexOf is a method of the String class. Since the indexOf method is overloaded, I will be using the indexOf(String str) version in this example. According to the API Documentation, this method "Returns the index within this string of the first occurrence of the specified substring." So, if you wanted to find the position of the letter 'v' in the String 'Java' and print it out, you would do this: String str = "Java"; int i = str.indexOf("v"); System.out.println(i); If the character you passed in the indexOf method does not exist in the String, indexOf would return a -1 (negative one).


How do you use sub string in java?

Substring method creates smaller string form bigger string , every time a new string is created but original character array buffer is used. so even if original string is 1G in size and substring is just 1K memory held by substring is 1G because of backed array. this can cause memory leak and prevent original string from garbage collection even if there is no direct reference.


What value is return by int main method?

1. A method declared as "int" returns an int value. 2. The main() method in Java is not declared as "int", but as "void", meaning it returns no value.


What is substr function does in c?

it will give the substring of length(as per the user) from the actual string,and the starting length from where it has to copy the substring from actual should be given by the user.


How is a method called in java?

method header and method body There are two ways to call a method; the choice is based on whether the method returns a value or not.


What is the meaning behind a javascript split?

The javascript split method, split(), will alter a string to make it into an array of substrings. This is useful if you would like to store each substring from the original string seperately.


What comes immediately before the method name in a declaration?

The return type of a method, if the method returns nothing then use 'void'


How do you convert a column coming in from a flat file as 93016 using skis sql services integration services 2008 into 09 30 2016 using ssis expressions?

Assumptions:1) the column had a name such as someDate2) the column is extracted as character rather than date, datetime or the like3) the days portion of the field always has 2 digits; only the month portion has an optional leading zero, implying the field will always have a length of either 5 or 6LEN(someDate) == 5 ?'0' + SUBSTRING(someDate,1,1) + ' ' + SUBSTRING(someDate,2,2) + ' 20' + SUBSTRING(someDate,4,2):SUBSTRING(someDate,1,2) + ' ' + SUBSTRING(someDate,3,2) + ' 20' +SUBSTRING(someDate,5,2)