length() returns the length of a string.
public static int strlen(String s, String t) {
int length = s.length() + t.length();
return length;
}
Function Call | Return Value | |||
---|---|---|---|---|
strlen("Bike", "grass") | → | |||
strlen("", "") | → | |||
strlen("56", "") | → | |||
strlen("Cat", "Dog") | → | |||
strlen("Golf", "Ball") | → |
Experiment with this code on Gitpod.io