Skip to content

Instantly share code, notes, and snippets.

@panterozo
Last active July 22, 2019 03:37
Show Gist options
  • Save panterozo/d5f3f90f29a02ffeedbe62d15b368d56 to your computer and use it in GitHub Desktop.
Save panterozo/d5f3f90f29a02ffeedbe62d15b368d56 to your computer and use it in GitHub Desktop.

Replace

This command will replace the first letter for its upper case letter, after obj[' element

:%s/obj\['\(\w\)/obj['\u\1/g

Usage:

if(this.hideValueFromForm('end_male2')){
  obj['End male2'] = arrayfieldbookList[j].flowering.end_male2 ? this.formatDateExcel(arrayfieldbookList[j].flowering.end_male2): '';
}

if(this.hideValueFromForm('fungicide')){
  obj['Fungicide'] = arrayfieldbookList[j].flowering.fungicide ? arrayfieldbookList[j].flowering.fungicide: '';
  obj['Fungicide dose'] = arrayfieldbookList[j].flowering.fungicide_dose ? arrayfieldbookList[j].flowering.fungicide_dose: '';
  obj['Fungicide date'] = arrayfieldbookList[j].flowering.fungicide_date ? this.formatDateExcel(arrayfieldbookList[j].flowering.fungicide_date): '';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment