JpnForPhp\Helper\Helper::charAt PHP Méthode

charAt() public static méthode

Returns the character at the specified index.
See also: subString()
public static charAt ( string $str, integer $index ) : string
$str string The input string.
$index integer The index of the character to return (0 based indexing).
Résultat string The character at the specified index.
    public static function charAt($str, $index)
    {
        return self::subString($str, $index, 1);
    }

Usage Example

Exemple #1
0
 public function testGetCharAtEndOfString()
 {
     $result = Helper::charAt($this->mixCharacters, -2);
     $this->assertEquals('す', $result);
 }