Skip to content

Instantly share code, notes, and snippets.

@yangsu
Last active December 11, 2015 22:08
Show Gist options
  • Save yangsu/4667033 to your computer and use it in GitHub Desktop.
Save yangsu/4667033 to your computer and use it in GitHub Desktop.
JavaScript String Example
"hello".charAt(0) // h
'cat'.charAt(1) == 'cat'[1] // true
"hello, world".replace("hello", "goodbye") // goodbye, world
"hello".toUpperCase() // HELLO
'Duke PL Course'.substring(5,7) // 'PL'
"1, 2, 3".split(', ') // ['1', '2', '3']
'Duke PL Course'.indexOf('Courses') // -1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment