toString

 

Summary

Returns a string representing the specified object.

Method of RegExp
Implemented in JavaScript 1.1
ECMAScript Edition ECMAScript 3rd Edition

Syntax

regexp.toString()

Parameters

None.

Description

The RegExp object overrides the toString method of the Object object; it does not inherit Object.toString. For RegExp objects, the toString method returns a string representation of the regular expression.

Examples

Example: Using toString

The following example displays the string value of a RegExp object:

myExp = new RegExp("a+b+c");
alert(myExp.toString());       // displays "/a+b+c/"

Tags (0)

Edit tags
  • No tags

Attachments (0)

 

Attach file