Forum Discussion

sv_sarma's avatar
sv_sarma
Occasional Contributor
11 years ago

Problem wih String Compare and String Find with "." character





Hi,



I am facing issues comparing strings that has "..." characters.



We have some data in spreadsheet, i.e., strings ending with "...", for example



test_type = "New..."



Now the following call doesn't return zero (0)



aqString.Find(test_type, "New...", 0, False)





Also when I wanted to select this value from a combo box object, like,



ComboBox("Test Type:").SelectItem test_type



it doesn't select this item from the list.



Tried with replacing it with "\.", it didn't work.



Is it that the character "." is replaced by any regular expression?



Any help on this is highly appreciated.



Thanks,

Sarma Kasibhatla


 


2 Replies

  • vajindarladdad's avatar
    vajindarladdad
    Frequent Contributor
    Hi,

    I have faced a similar issue earlier.



    Could you please check the last character of the string. i.e. "dot"



    I have mentioned 2 examples below.

    The first one is 3 dot characters & the second one is a single character which consists of 3 dot characters.

     

    1) ...

    2) …



    I have attached the text file for the same.



    If this is the case , please mention the correct charcters in the string.



    I hope this has been of some help.



  • I'd have to double check, but if I recall correctly, aqString.Find returns -1 if it doesn't find the substring.



    To answer your question three periods are also know as an ellipsis (Chr(133)) I'm not sure if Test complete would fail a comparison for a Chr(133) instead of three Chr(46).