On 08/25/10 14:46, Jed wrote:
I would like to split the string 'churro' into a list containing:
'ch','u','rr','o'
Dirt simple, straightforward, easily generalized solution:
def sp_split(s):
n,i,ret = len(s), 0, []
while i < n:
s2 = s[i:i+2]
if s2 in ('ch', 'll', 'r
Jed wrote:
Hi, I'm seeking help with a fairly simple string processing task.
I've simplified what I'm actually doing into a hypothetical
equivalent.
Suppose I want to take a word in Spanish, and divide it into
individual letters. The problem is that there are a few 2-character
combinations that
On Wednesday 25 August 2010, it occurred to Jed to exclaim:
> Hi, I'm seeking help with a fairly simple string processing task.
> I've simplified what I'm actually doing into a hypothetical
> equivalent.
> Suppose I want to take a word in Spanish, and divide it into
> individual letters. The probl
On 08/25/10 14:46, Jed wrote:
Hi, I'm seeking help with a fairly simple string processing task.
I've simplified what I'm actually doing into a hypothetical
equivalent.
Suppose I want to take a word in Spanish, and divide it into
individual letters. The problem is that there are a few 2-character
On 25/08/2010 20:46, Jed wrote:
Hi, I'm seeking help with a fairly simple string processing task.
I've simplified what I'm actually doing into a hypothetical
equivalent.
Suppose I want to take a word in Spanish, and divide it into
individual letters. The problem is that there are a few 2-charact
Jed writes:
> alphabet = ['a','b','c','ch','d','u','r','rr','o'] #this would
> include the whole alphabet but I shortened it here
> theword = 'churro'
>
> I would like to split the string 'churro' into a list containing:
>
> 'ch','u','rr','o'
All non-overlapping matches, each as long as can be,
2010/8/25 Jed :
> Hi, I'm seeking help with a fairly simple string processing task.
> I've simplified what I'm actually doing into a hypothetical
> equivalent.
> Suppose I want to take a word in Spanish, and divide it into
> individual letters. The problem is that there are a few 2-character
> com
Hi, I'm seeking help with a fairly simple string processing task.
I've simplified what I'm actually doing into a hypothetical
equivalent.
Suppose I want to take a word in Spanish, and divide it into
individual letters. The problem is that there are a few 2-character
combinations that are considere