TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

JavaScript Symbol split Property

JavaScript Symbol split Property with examples on javascript symbol methods, javascript symbol property, javascript tutorial, hasInstance, isConcatSpreadable, match, prototype, search, for(), keyFor(), toString(), unscopables, toPrimitive, split etc.

<< Back to JAVASCRIPT

JavaScript Symbol.split Property

The JavaScript Symbol.split symbol is used to split a string at the indices that match the regular expression.

Syntax

Symbol.split(string)

Parameters

String

Return value

A string that split from the given expression

Browser Support

Chrome 32
Safari 8
Firefox 29
Opera 19

Example

<script>
//JavaScript to illustrate Symbol.split
class Sp 
{
  constructor(value)
 {
    this.value = value;
  }
 [Symbol.split](string) 
{
var index = string.indexOf(this.value);
   return this.value; 
}
}
document.write("We split point from the string JavaTpoint<br>")
document.write('JavaTpoint'.split(new Sp('point')));
//expected output:We split point from the string JavaTpoint
//point
</script>
Test it Now

Output:

We split point from the string JavaTpoint
point.

Next TopicJavaScript Symbol




Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf