How to get class name and split the string and then compare?

In my test I need to get the class name such as “bank-logo b2”,“bank-logo b70”,“bank-logo b***” and split the class name and validate the “b2”,“b70”,“b**” with the text in the iframe.
Can someone please let me know if I need to add a plugin to do this?