Split string in jquery

Another method to get this would be to use a simple regex. The regex uses capturing groups to group the data like you want. In my example, the capturing groups are the items surrounded by parentheses. The regex is just grabbing the matching group 1 on everything before the last period, which corresponds to the … Read more

Fastest way to remove first char in a String

The second option really isn’t the same as the others – if the string is “///foo” it will become “foo” instead of “//foo”. The first option needs a bit more work to understand than the third – I would view the Substring option as the most common and readable. (Obviously each of them as an individual statement … Read more

How does str(list) work?

Well you have a total of 4 questions, let us go one by one. 1. Why does str(list) returns how we see list on the console? How does str(list) work? What is str() and __str__()? The str() callable is to return a printable form of the object only! From the docs str(object) does not always attempt to return a string that is acceptable to eval(); its goal is to return a … Read more

Difference between String replace() and replaceAll()

In java.lang.String, the replace method either takes a pair of char’s or a pair of CharSequence‘s (of which String is a subclass, so it’ll happily take a pair of String’s). The replace method will replace all occurrences of a char or CharSequence. On the other hand, the first String arguments of replaceFirst and replaceAll are regular expressions (regex). Using the wrong function can lead to subtle bugs.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)