All ways to partition a string
<p>I'm trying to find a efficient algorithm to get all ways to partition a string </p>

<p>eg for a given string 'abcd' =><br>
'a' 'bcd'<br>
'a' 'b' 'cd'<br>
'a' 'b' 'c' 'd'<br>
'ab' 'cd'<br>
'ab' 'c' 'd'<br>
'abc' 'd'<br>
'a', 'bc', 'd  </p>

<p>any language would be appreciated</p>

<p>Thanks in advance !</p>