how to correct address to upper case - InfoPath Dev
in

InfoPath Dev

how to correct address to upper case

Last post 09-19-2008 02:40 PM by Hilary Stoupa. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-19-2008 08:04 AM

    how to correct address to upper case

    I'm using InfoPath2003

    How would I go about correcting an address to use upper case letters?

     ie correct 123 main street to 123 Main Street

    TIA

  • 09-19-2008 12:27 PM In reply to

    Re: how to correct address to upper case

    I think I'm on the right path, but I'm still stuck and hope someone can help out.  I have found that the following forumula will translate the first letter of the first word to an upper case.

    concat(substring(translate(., "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 1, 1), substring(., 2, string-length(.) - 1))

    ie main street becomes Main street

    How can I get it so both words are changed to upper case?

  • 09-19-2008 02:40 PM In reply to

    Re: how to correct address to upper case

    You could try substring-after to get the word after the space:

    substring-after("main street", " ")

    will return "street", for example.

    So, using your formula above, if the value of the current node is "main street":

    concat(substring(translate(substring-after(., " "), "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"), 1, 1), substring(substring-after(., " "), 2, string-length(substring-after(., " ")) - 1))

    should return "Street". Mind you -- I didn't test the above formula, just replaced the '.' character with 'substring-after(., " ")'.

    That being said, how will you handle addresses with more than two words? Like if it is West Main Street?

    Hilary Stoupa

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.