BOX8 | Write a regular expression to split a paragraph every time it finds an exclamation mark

Question

RegEx

solved 0
TheDataMonk 55 years 5 Answers 1082 views Grand Master 1

Answers ( 5 )

  1. paragraph.split(“!”)

    Best answer
  2. 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(“!”)

  3. str.split(“!”)

  4. paragraph.split(‘!’)

  5. str.split(“!”)

Leave an answer

Browse
Browse