Tech Study

JavaScript String substring() Method

Substring Javascript

The javascript substring() method returns extracted characters between two given indices of a string and returns the substring. It extracts characters from starting index to the ending index inclusive. It doesn’t modify the original string. In fact, if the start at any time is greater than end the arguments are swapped, and if any of them (start or end) is less than zero, they are treated as zero. 

If fractions are found in place of indices, they’ll be converted to floor values ( integer values less than or equal to a given value).

SYNTAX – string. Substring(starting_Index, ending-Index)

  1. Starting_index – the needed first position. The first character is at index 0 ( 0-based indexing ).
  2. ending_index – the required last position(not including this position). It is optional.

For example-

let str = “techStudy”
a = str.substring(0,4);










Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more