This Gist was automatically created by Carbide, a free online programming environment.
Last active
December 12, 2016 07:54
-
-
Save wonkwh/69563845ed2ff1741bc194b7539e5459 to your computer and use it in GitHub Desktop.
javascript String operation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function verbFunc() { | |
| return "무슨말이냐."; | |
| } | |
| var niceMan = "광현이"; ///es6 에 추가된 \\**templeate string ** | |
| var jadeTalk = `一生负气成今日 \n ${verbFunc()} , 语出 ${niceMan} 的《忆故居》。 | |
| ` | |
| console.log(jadeTalk) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let str = 'www.kwangHYyun.com' ///**대소문자 변환** | |
| str.toLowerCase() | |
| str.toUpperCase() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let str = 'www.kwangHYyun.com' ///substring\\ | |
| str.substring(0,3) | |
| str.substring(0) | |
| str.substring(-2) | |
| str.slice(0,3) | |
| str.slice(-3,-1) | |
| str.slice(1,-1) | |
| str.substr(0,3) | |
| str.split('.') ///str.split( _**[separator] [, limit]**_) | |
| str.split('.', 1) | |
| str.split('.').join('') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment