Forum Discussion
4 Replies
- rishi_1Occasional Contributorwell thanks for the response david..i already knew this method and used it but my question is how to verify whther spaces has been removed or not?
- tristaanogreEsteemed ContributorWhy not just do a string comparison of before and after using aqString.Compare http://smartbear.com/support/viewarticle/13706/ ?
Or, you can use aqString.Contains to see if your string contains a space http://smartbear.com/support/viewarticle/13703/ ? - Hi Rishi,
The aqString.Trim method unequivocally removes the spaces. There is no need to verify it.
However, you can use aqString.StrMatches. The below code posts True to the test log if there are leading spaces (the first line) or trailing spaces (the second line), and False otherwise.Log.Message(aqString.StrMatches("^\b+.+", text))
Log.Message(aqString.StrMatches(".+$\b+", text))