UCASE and LCASE - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

UCASE and LCASE

Last post 06-22-2005 12:29 AM by Coita Thierry. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 11-11-2004 05:35 AM

    UCASE and LCASE

    Would like to see this as an option in the functions, so that I won't have to write code for this.
  • 11-11-2004 05:42 AM In reply to

    • jonbrave
    • Top 200 Contributor
    • Joined on 10-15-2004
    • United Kingdom
    • Posts 59
    This can be done with XPath "translate" function.
  • 11-11-2004 02:20 PM In reply to

    isn't translate the same thing as replace? As pertaining to my issue, I won't need it because I was actually attempting to compare a node to a String within the code, found another way to do this.
  • 11-12-2004 01:33 AM In reply to

    • jonbrave
    • Top 200 Contributor
    • Joined on 10-15-2004
    • United Kingdom
    • Posts 59
    Kind of :)

    translate(source, 'ABC...', 'abc...')
    [yes, you have to type in every letter!] does LCASE. Each char is replaced/translated from it postion (i.e. index) found in 'ABC...' to the same position in 'abc...'. Rudimentary, but that's all XPath offers natively.

    This all goes back to 'tr' in Perl/SED from UNIX days... :)
  • 11-19-2004 02:32 AM In reply to

    Note: this translate is useful if you are doing filtering and you want to do a case insensitive filter on a text value.
    Patrick Halstead
    Project Manager at Qdabra
  • 06-07-2005 01:03 PM In reply to

    • BrownR
    • Top 200 Contributor
    • Joined on 08-14-2004
    • USA
    • Posts 54
    Interesting that i find this. Im trying to compair the username (whos logged in) to a data field. The names in the datafeild are all in lowercase but of course anybody can log in with upper and lowercase if they like. If i compair the two and they're not both in lower case it doesnt see the name on the list. How can i use "Translate" to solve this?
  • 06-12-2005 03:17 AM In reply to

    Hello BrownR,
    You can solve this by doing a translate on the two value so that both of them are in the same case and them compare them. Something like this will be part of your xpath.
    translate(Customer/LastName,'QWERTYUIOPLKJHGFDSAZXCVBNM','qwertyuioplkjhgfdsazxcvbnm') = translate(\"{1}\", 'QWERTYUIOPLKJHGFDSAZXCVBNM','qwertyuioplkjhgfdsazxcvbnm')

    Shanthi
    InfoPathDev India
    Shanthi Reddy
  • 06-22-2005 12:29 AM In reply to

    Hi,

    You have an XPATH function for do that:

    upper-case(string) Converts the string argument to upper-case
    Example: upper-case('The XML')
    Result: 'THE XML'

    lower-case(string) Converts the string argument to lower-case
    Example: lower-case('The XML')
    Result: 'the xml'


    ++

    Thierry


    Every moment hesitated is a moment gone for life!!! Think about it
    Infopath 2007, Langage: C#2.0 (Modèle Objet 2003)
    merci de lire ceci
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.