Conditionally return either the first character, or first two characters of a field

Hello,

Is it possible, with Sugar Logic or BPM, to return either the first letter or first two letters of a field (conditionally)?

For example, if a field value was "L878", I would simply need the result to say "L".

However, if a field value was "LE878", I would need the result to say "LE".

Many thanks