The startsWith() method returns true if a string starts with a specified value; otherwise, it returns false. The method is case-sensitive.
In this interactive example, you can check whether a string starts with a selected prefix. Enter the desired beginning in the field and see the result and explanation in the “Results” area. You can also click the prepared examples (Good, day, GOOD, !) or try practical scenarios below for email addresses, URLs, and file names. Keep in mind that startsWith() is case-sensitive; for a case-insensitive check, normalize both strings first (e.g., with toLocaleLowerCase()).
Check the beginning of a text
Enter the beginning of the text you want to check
Email check:
URL check:
File check:
Thank you for visiting! Adding privacy policy.
© 2024 All rights reserved.
Vam je koda pomagala? Če želite podpreti moj trud pri pripravi vodičev in vzdrževanju strani, mi lahko namenite donacijo za kavo.