Get the App
SLTechnology News&Howtos  ›  Database  › 

Analysis of MySQL PHP Grammar

Shulou Source: shulou.com Published: 2022-06-01 03:38:19 10月14日 Update

Let's first take a look at the basic syntax of the charAt function

Character = str.charAt (index)

The only argument to the charAt function is the index in the string from which a single character is extracted. The range of this index is between 0 and length-1, including restrictions. If no index is specified, the first character of the string is returned because 0 is the default index for this function.

Function returns a single character at the index specified as a function argument. If the index is out of range, this function returns an empty string.

Let's take a look at the concrete example of the charAt function.

The code is as follows

Function func () {var str = 'JavaScript is object oriented language'; var value = str.charAt (9); [xss_clean] (value);} func ()

The output is as follows: t

The above content is very simple, thank you for your reading and support.

Tags: Function character index single parameter string range syntax between from code content example null character result first come support output limit Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info NVidia Huawei Shulou Information MariaDB