Erstes Zeichen eines Strings in Javascript ermitteln
English
Deutsch
Verwende s.charAt(0)
Beispiel:
first_char_js_example.js
const s = "banana";
const firstChar = s.charAt(0); // == 'b'
// Dies gibt 'b' aus
console.log(firstChar);Check out similar posts by category:
Javascript
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow