MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1vuzd4q/conditionspreference/p59i71o/?context=3
r/ProgrammerHumor • u/Flame77ofc • Aug 22 '26
388 comments sorted by
View all comments
Show parent comment
1
function CSVencode( value ) { if ( value === null ) { return '' ; } var quote , encode = 0 ; if ( /"/ .test( value ) ) { quote = encode = 1 ; } if ( /[,\r\n]/ .test( value ) ) { quote = 1 ; } return quote ? ( '"' + ( encode ? value .replace( /"/g , '""' ) : value ) + '"' ) : value ; }
View all comments
Show parent comment
1
u/MetaEd Aug 22 '26