I'm trying to cut off string in PreactJS as follow,
mystring.subString(0, 10)
unfortunately, error found that 'subString' undefined or something else seem it does not work. Please let me know how to do it?
I'm trying to cut off string in PreactJS as follow,
mystring.subString(0, 10)
unfortunately, error found that 'subString' undefined or something else seem it does not work. Please let me know how to do it?
This has nothing to do with Preact
, it's a syntax error
It should be : 'mystring'.substring(0, 10)
@daniel is correct. And the following is also possible :-
'mystring'.substr(0, 10)