repl.txt (1075B)
1 2 {{alias}}( str, search[, len] ) 3 Tests if a `string` ends with the characters of another `string`. 4 5 If provided an empty `search` string, the function always returns `true`. 6 7 Parameters 8 ---------- 9 str: string 10 Input string. 11 12 search: string 13 Search string. 14 15 len: integer (optional) 16 Substring length. Restricts the search to a substring within the input 17 string beginning from the leftmost character. If provided a negative 18 value, `len` indicates to ignore the last `len` characters, returning 19 the same output as `str.length + len`. Default: `str.length`. 20 21 Returns 22 ------- 23 bool: boolean 24 Boolean indicating whether a `string` ends with the characters of 25 another `string`. 26 27 Examples 28 -------- 29 > var bool = {{alias}}( 'beep', 'ep' ) 30 true 31 > bool = {{alias}}( 'Beep', 'op' ) 32 false 33 > bool = {{alias}}( 'Beep', 'ee', 3 ) 34 true 35 > bool = {{alias}}( 'Beep', 'ee', -1 ) 36 true 37 > bool = {{alias}}( 'beep', '' ) 38 true 39 40 See Also 41 -------- 42