Skip to content

Instantly share code, notes, and snippets.

@guaiamum
Created May 28, 2018 11:05
Show Gist options
  • Save guaiamum/3945f6a8ca652826fc3783b3e6ba9824 to your computer and use it in GitHub Desktop.
Save guaiamum/3945f6a8ca652826fc3783b3e6ba9824 to your computer and use it in GitHub Desktop.
transforms multiline property listing string into class members in c#
/**
* @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