Remove the leading @ from a username, if present
@
WhatsApp accepts a prefixed username but logs a warning and reports it, so always strip it before handing the value to a native function.
stripUsernamePrefix('@someusername'); // 'someusername'stripUsernamePrefix('someusername'); // 'someusername' Copy
stripUsernamePrefix('@someusername'); // 'someusername'stripUsernamePrefix('someusername'); // 'someusername'
Remove the leading
@from a username, if presentWhatsApp accepts a prefixed username but logs a warning and reports it, so always strip it before handing the value to a native function.