BOX8 | Write a regular expression to split a paragraph every time it finds an exclamation mark
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 5 )
paragraph.split(“!”)
You can use the .split() method to split any string you pass on to
the function. The argument you pass on to the split function acts as
a delimiter and your string will be tokenized on the basis of the argument.
If no argument is provided, it takes white-space as the separator.
Ex :
suppose you have a string in str variable.
str.split(“!”)
str.split(“!”)
paragraph.split(‘!’)
str.split(“!”)