Validate Multiple Emails Comma Separated with javascript

后端 未结 9 2129
无人及你
无人及你 2021-01-12 05:03

I want to validate a string which can be an email or multiple emails separated by commas.

For example:

bill.gates@hotmail.com -> TRUE
bill -> FALSE

9条回答
  •  旧巷少年郎
    2021-01-12 05:50

    I would throw an $.trim(result[i]) into that validateMultipleEmailsCommaSeparated function as many people will add the space after their comma.

    Of course that is a jQuery thing so do the equivalent your way.

提交回复
热议问题