If I have a
String myName = "First Last";
How can I, without an if or any other conditionals/loops, return just the initials of the name??
I've been looking forever on this!
Thanks
Since you can't loop or use conditionals, you can't check anything, so this is your only choice:
/**
* Gets the initials from a String. Note: Only works on the String "First Last"
*/
String getInitials(String s) {
return "FL";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With