XQuery Question:
Download Questions PDF

Some elements on the web page I am testing contain leading (trailing) whitespaces. I am using the Utilities.Trim function to remove them, but sometimes it does not work. What is wrong?

Answer:

There are several types of whitespace characters that can be used in HTML pages: “usual” spaces (with ASCII code 32), non-breaking spaces ( , code 160), end spaces ( , code 8194) and others. For more information on these characters, see the Whitespace and Formatting Characters article. The Utilities.Trim function only removes the “usual” spaces from the string. To remove other whitespaces, you can use the Utilities.StringReplace function to replace them with empty strings. For example, the code snippet below demonstrates how to remove non-breaking spaces from a string

Download XQuery Interview Questions And Answers PDF

Previous QuestionNext Question
What is the purpose of compatibility testing?How can I find a specific image within a web page?