Dapatkan karakter pertama string java
var string = "freeCodecamp";
string.charAt(0); // Returns "f"
Red Necked Phalarope
var string = "freeCodecamp";
string.charAt(0); // Returns "f"
public String firstElement(String[] array)
{
if (array.length >= 1)
{
return array[0];
}
else {
return "";
}
}