GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • JS Array Object
  • JS Boolean Object
  • JS Date Object
  • JS Math Object
  • JS Number Object
  • JS String Object
  • JS Reserved Keywords
  • More references

This view

  • Original page
  • New address

GeezerVison is showing www.tutorialrepublic.com — JavaScript String Properties and Methods - Tutorial Republic

TutorialRepublic
HOME HTML5 CSS3 JAVASCRIPT JQUERY BOOTSTRAP5 v4.6 PHP7 SQL REFERENCES EXAMPLES FAQ SNIPPETS Online HTML Editor
JAVASCRIPT BASIC
JS Introduction JS Getting Started JS Syntax JS Variables JS Generating Output JS Data Types JS Operators JS Events JS Strings JS Numbers JS If…Else JS Switch…Case JS Arrays JS Sorting Arrays JS Loops JS Functions JS Objects
JAVASCRIPT & DOM
JS DOM Nodes JS DOM Selectors JS DOM Styling JS DOM Get Set Attributes JS DOM Manipulation JS DOM Navigation
JAVASCRIPT & BOM
JS Window JS Screen JS Location JS History JS Navigator JS Dialog Boxes JS Timers
JAVASCRIPT ADVANCED
JS Date and Time JS Math Operations JS Type Conversions JS Event Listeners JS Event Propagation JS Borrowing Methods JS Hoisting Behavior JS Closures JS Strict Mode JS JSON Parsing JS Error Handling JS Regular Expressions JS Form Validation JS Cookies JS AJAX Requests JS ES6 Features
JAVASCRIPT EXAMPLES
JS Practice Examples JS FAQ's Answers
JAVASCRIPT REFERENCE
  • JS Properties and Methods
    • JS Array Object
    • JS Boolean Object
    • JS Date Object
    • JS Math Object
    • JS Number Object
    • JS String Object
  • JS Reserved Keywords
  • More references
Advertisements

JavaScript String Reference

This chapter contains a brief overview of the properties and method of the global String object.

The JavaScript String Object

The JavaScript String object is a global object that is used to store strings. A string is a sequence of letters, numbers, special characters and arithmetic values or combination of all.

To learn more about String, please check out the JavaScript strings chapter.

String Properties

The following table lists the standard properties of the String object.

Property Description
length Returns the length of a string.
prototype Allows you to add new properties and methods to an String object.

Note: Every object in JavaScript has a constructor property that refers to the constructor function that was used to create the instance of that object.


String Methods

The following table lists the standard methods of the String object.

Method Description
charAt() Returns the character at the specified index.
charCodeAt() Returns the Unicode of the character at the specified index.
concat() Joins two or more strings, and returns a new string.
endsWith() Checks whether a string ends with a specified substring.
fromCharCode() Converts Unicode values to characters.
includes() Checks whether a string contains the specified substring.
indexOf() Returns the index of the first occurrence of the specified value in a string.
lastIndexOf() Returns the index of the last occurrence of the specified value in a string.
localeCompare() Compares two strings in the current locale.
match() Matches a string against a regular expression, and returns an array of all matches.
repeat() Returns a new string which contains the specified number of copies of the original string.
replace() Replaces the occurrences of a string or pattern inside a string with another string, and return a new string without modifying the original string.
search() Searches a string against a regular expression, and returns the index of the first match.
slice() Extracts a portion of a string and returns it as a new string.
split() Splits a string into an array of substrings.
startsWith() Checks whether a string begins with a specified substring.
substr() Extracts the part of a string between the start index and a number of characters after it.
substring() Extracts the part of a string between the start and end indexes.
toLocaleLowerCase() Converts a string to lowercase letters, according to host machine's current locale.
toLocaleUpperCase() Converts a string to uppercase letters, according to host machine's current locale.
toLowerCase() Converts a string to lowercase letters.
toString() Returns a string representing the specified object.
toUpperCase() Converts a string to uppercase letters.
trim() Removes whitespace from both ends of a string.
valueOf() Returns the primitive value of a String object.
Previous Page Next Page
Advertisements
Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties
Advertisements

Is this website helpful to you? Please give us a like, or share your feedback to help us improve. Connect with us on Facebook and Twitter for the latest updates.

About Us

Our Story Terms of Use Privacy Policy

Contact

Contact Us Report Error Guest Posts Advertise

Interactive Tools

Bootstrap Icon Search Utility HTML Formatter Title & Meta Length Calculator HTML Color Picker Bootstrap Button Generator SQL Playground Font Awesome Icon Finder HTML Editor

TutorialRepublic

BMC
Copyright © 2026 Tutorial Republic. All Rights Reserved.
Share This:
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.