Here is my code to match a String like:
String name = qualified.replaceAll(".*\\.(?=\\w+)", "");
Where it gets from input org.myapp.TestData$RootEntity a TestData$RootEntity
However I need to be able to get just the RootEntity part of the String. Effectively getting just this.
Input Strings:
com.domain.app.RootEntity
com.domain.app.TestData$RootEntity
com.domain.app.TestData$TestNested$RootEntity
And should be able to get RootEntity
string.lastIndexOf('$')