Should be pretty self-explanatory.
public class Main
{
public static void main(String[] args) {
String str = "Get#the#Acronym";
getAcronym(str);
}
public static void getAcronym(String str){
String[] parts = str.split("#");
for(var item : parts){
char a = item.charAt(0);
System.out.print(a);
}
}
}
I've already solved it this way, but was wondering if there is a shorter way without regex?