Hi,
I think the fast way is adding an autoNumber attribute to the entity to keep the count and use that value to create your string.
Otherways you can every time retrieve the last created instance cut the string and use that to find the current value.