That is why both TestComplete and VBScript have their own methods to compare one string value with another. Generally, a test procedure obtains textual data (user input, file contents, property values and so on) and then compares it with the expected data. String comparison is widely used during testing. Returns a string that has been converted to uppercase.ĭecodes a string encoded with the Escape function. Returns a copy of a string without leading and trailing spaces. Returns a string in which the character order of a specified string is reversed. Returns a repeating character string of the length specified. Returns a value indicating the result of a string comparison. Returns a zero-based, one-dimensional array containing a specified number of substrings. Returns a string consisting of the specified number of spaces. Returns a copy of a string without trailing spaces. Returns a specified number of characters from the right side of a string. Returns a string in which a specified substring has been replaced with another substring a specified number of times. Returns a specified number of characters from a string. Returns a copy of a string without leading spaces. Returns the number of characters in a string or the number of bytes required to store a variable. Returns a specified number of characters from the left side of a string. Returns a string that has been converted to lowercase. Returns a string created by joining a number of substrings contained in an array. The search can start at a given position and use binary (compare=0) or text (compare=1) comparisons. Returns the position of an occurrence for one string within another, from the end of string. Returns the position of the first occurrence for one string within another.The search can start at a given position and use binary (compare=0) or text (compare=1) comparisons. Non-ASCII characters are replaced with % xx encoding, where xx is equivalent to the hexadecimal number representing the character. Returns an expression that has been converted to a variant of sub-type string.Įncodes a string so it only contains ASCII characters. Returns the character associated with the specified ANSI character code. Returns the ASCII character code corresponding to the first letter in a string. The table below only lists major functions: Function A detailed description of VBScript functions can be found in the Functions (VBScript) article of the MSDN library. MethodĬonverts a currency value to a string using the specified format settings.Ĭonverts the given date value to a string using the specified format.Ĭonverts the given date value to a string.Ĭonverts a floating-point value to a string.Ĭonverts the specified string to a currency value.Ĭonverts the specified string to a date value.Ĭonverts the specified string to a date/time value.Ĭonverts the specified string to a floating-point value.Ĭonverts the specified string to an integer value.Ĭonverts the specified string to a long integer value.Ĭonverts the specified string to a time value.Ĭonverts the specified variant value to a string.įurthermore, you can use native VBScript functions that operate with strings. This object has several methods that convert values of different types to a string representation and vice versa. Removes spaces and control characters from the specified string.Ĭonverts a quoted string to an unquoted string.Īnother scripting object that is useful for string manipulation is aqConvert. Retrieves a substring from the input string.Ĭonverts the specified string to lower case.Ĭonverts the specified string to upper case. Replaces all the occurrences of one substring with another substring. Removes a number of characters from the input string. Specifies a symbol used as a quotation mark. Specifies a character used to separate individual values in a list. Inserts one string to another at the specified position. Returns the number of items in the string list. Returns an individual item from the list passed through the input string. Returns the number of characters in a string. Retrieves a single character from the input string. Use this method instead of the obsolete aqString.Contains. Searches for a substring within the given string. Removes an item with the given index from a string list. Method, PropertyĬhanges the value of the string list item with the given index. The object is available for all supported scripting languages, so that you can use it to operate with string values regardless of the chosen language. To deal with strings, TestComplete has a special aqString scripting object.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |