Python String Extraction for football results
<p>I have the following string:</p>

<pre><code>"W-Leicester-3-0-H|W-Hull-2-0-A|L-Arsenal-0-3-A|L-Liverpool-1-2-H|D-Swansea-2-2-A"
</code></pre>

<p>What I would like to do is manipulate the string above so it returns the results of each game which is the first letter after each "|".  In this instance it would be WWLLD.</p>

<p>Many thanks in advance, Alan.</p>

<p>Try something like this:</p>

<pre><code> string = "W-Leicester-3-0-H|W-Hull-2-0-A|L-Arsenal-0-3-A|L-Liverpool-1-2-H|D-Swansea-2-2-A"
 result = ''.join([s[0] for s in string.replace('||', '|').split('|')])
</code></pre>

python string