I have a dataframe with a column "A" whose values can be as such:

```
[';', '', 'M;', 'M', ';M', 'M;M', ';;M']

```

I would like to return the value 'M' in my second column "B" if I can find "M" (it doesn't matter if there are several M's) in the row on column A. If there is no M, the row in B should stay empty.
I'm having trouble translating this into a lambda function. Can anyone help please?

```
df['B']=df['A'].apply(lambda x:x[....... if 'M' in x else None])

```