$molform =~ s/\s+$//; [download]
In reply to Re^9: How to avoid an alphabet and integer next to it in a string? by runrig in thread How to avoid an alphabet and integer next to it in a string? by piscean