📅  最后修改于: 2022-03-11 15:00:09.989000             🧑  作者: Mango
String x = "Stephen Ricard";
String[] nameparts = x.split(" ");
String initials = nameparts[0].charAt(0).toUpperCase()+nameparts[1].charAt(0).toUpperCase(); //Output: SR