I have package :
com.google.*.*.*
There may be many subpackages.
I have a Class foo.java
How to check if its inside the main package com.google
When I use Class.getPackage(), it gives only the whole package like this:
com.google.util.domain.sup
Must I really use functions like : substring() , split(). Or is there a fancy way to check if it belongs to certain parent packages?
Do you mean like…
if you need an exact match you can use