Created
May 28, 2018 11:05
-
-
Save guaiamum/3945f6a8ca652826fc3783b3e6ba9824 to your computer and use it in GitHub Desktop.
transforms multiline property listing string into class members in c#
This file contains 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
/** | |
* @param {string} str : multiline string | |
* @return {string} result | |
*/ | |
function genProps(str){ | |
let arr = str.split('\n'); | |
let ini = 'public string '; | |
let fim = ' {get;set;}\n'; | |
return ini+ arr.join(fim + ini) + fim; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment