I Need to get the Root Group Name of a Group.
How can i achieve this.
The Root group of every group is the same, so $core_v2_group.Root will get you that.
I had solved this by taking the url of the group and splitted it to parts and obtained the key of the Root Group.
As Matt said, there is no reason to do this at all, you would be much better off using core_v2_group.Root. That is the proper way to reference site root.