Skip to content

Latest commit

 

History

History
51 lines (41 loc) · 1.24 KB

File metadata and controls

51 lines (41 loc) · 1.24 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.technology ms.tgt_pltfrm ms.topic dev_langs ms.assetid caps.latest.revision author ms.author manager
startsWith Method (String) (JavaScript) | Microsoft Docs
01/18/2017
windows-client-threshold
devlang-javascript
language-reference
JavaScript
TypeScript
DHTML
871def4a-0f96-4675-b6ff-2349f4996511
2
mikejo5000
mikejo
ghogen

startsWith Method (String) (JavaScript)

Returns a value that indicates whether a string or substring starts with another specified string.

Syntax

  
stringObj.startsWith(str, [, position]);  

Parameters

stringObj
Required. The string object to search against.

str
Required. The search string.

position
Optional. The position of the first character to search against in the string object, starting at 0.

Return Value

If the string beginning at position starts with the search string, the startsWith method returns true; otherwise, it returns false.

Exceptions

If str is a RegExp, a TypeError is thrown.

Remarks

Requirements

[!INCLUDEjsv12]