Is it necessary to use — and – in XHTML or HTML5?

The W3C released an official response about when to use and when not to use character escapes which you can find here. As they are also the group that is in charge of the HTML specification, I think it’s best to follow their advice. From the section “When to Use Escapes” Syntax characters. There are … Read more

c# replace \” characters

Were you trying it like this: string text = GetTextFromSomewhere(); text.Replace(“\\”, “”); text.Replace(“\””, “”); ? If so, that’s the problem – Replace doesn’t change the original string, it returns a new string with the replacement performed… so you’d want: string text = GetTextFromSomewhere(); text = text.Replace(“\\”, “”).Replace(“\””, “”); Note that this will replace each backslash … Read more

How to detect line breaks in a text area input?

You can use match on the string containing the line breaks, and the number of elements in that array should correspond to the number of line breaks. enteredText = textareaVariableName.val(); numberOfLineBreaks = (enteredText.match(/\n/g)||[]).length; characterCount = enteredText.length + numberOfLineBreaks; /\n/g is a regular expression meaning ‘look for the character \n (line break), and do it globally … Read more

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