Compare string

lukry
lukry Member Posts: 12
edited 2006-06-15 in Dynamics AX
how i can compare two string (second position) in axapta
xxxxAx xxxxBx ?

Comments

  • kashperuk
    kashperuk Member Posts: 53
    To compare to strings in Axapta you can use the == operator. It's not case sensitive.
    The case sensitive one is strCmp(str1, str2)
    If you need to compare only parts of the string, you can use the subStr() function.

    strCmp(substr(str1, 5, 1), substr(str2, 5, 1)) will return false, because A is not equal to B.

    Also, do please check the SystemDocumentation\Functions\str*
    There are plenty of functions you might find useful there
    Vanya Kashperuk,
    My blog - http://kashperuk.blogspot.com
    MorphX IT in Russian - http://www.lulu.com/content/723888
    Inside Dynamics AX 4.0 in Russian - http://www.ozon.ru/context/detail/id/3714582