Skip to content

Instantly share code, notes, and snippets.

@adamlacombe
Last active December 18, 2020 19:51
Embed
What would you like to do?
Transform invite csv - capitalize name columns and lowercase emails
`First Name,Last Name,Email
john,doe,John.Doe@example.com
bobby,joe,Bobby.Joe@example.com`
.split('\n')
.map(r => r
.split(',')
.map((c, cIndex) => (cIndex === 2)
? c.toLowerCase()
: c.charAt(0).toUpperCase() + c.slice(1).toLowerCase())
.join(","))
.join('\n');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment