12 lines
215 B
XML
12 lines
215 B
XML
function getFirstCharacter(str, showFullIndex) {
|
|
var res = str.toString();
|
|
if (showFullIndex) {
|
|
return res;
|
|
}
|
|
return res.substring(0, 1);
|
|
}
|
|
|
|
module.exports = {
|
|
getFirstCharacter: getFirstCharacter,
|
|
};
|