Searching a String - InfoPath Dev
in

InfoPath Dev

Searching a String

Last post 12-17-2007 01:21 PM by Clay Fox. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-17-2007 12:08 PM

    Searching a String

    I would like to be able to search a string in JScript.  For example, I would like to be able to search a string for a space, and I will also know what the characters are after the space.  For example,  say i have a string "Testing." and another string "Testing ."  I would like to be able to search to find out if there is a space before the period.  Any ideas? thanks 

  • 12-17-2007 12:40 PM In reply to

    I do this quite often using the built in InfoPath functions string-before and string-after. These can be nested to do about whatever you want.  Unfortunately, I am not sure what the Jscript equivalents would be.

    Can you do it within Infopath instead of code? Often you can set up a rule that will just validate the value and if needed strip spaces or whatever.

  • 12-17-2007 12:48 PM In reply to

     Well this is my problem.  For example, I have some forms that are saved as "Doe, John.xml" and "Doe, Jane .xml".  Due to a mistake in the Save and Close code, some forms have a space before the ".xml".  And I have like 20,000 forms in my library so to go through each one is not to much of an option.  I can get the filename in JScript by doing the XDocument.URI.  But I was wondering if there was an easy way to see if the string contains a " " before the ".xml".  Does this make sense?

  • 12-17-2007 01:21 PM In reply to

    It sounds like you need a windows script which will go through all of your documents and rename them if needed.

    Another option is this Watch directory tool which I have used before.  It can do renaming with replacement. You would maybe have to copy files to a folder and then back but it has a 30 day trial period so you can install and test immediately.  http://www.watchdirectory.net

     

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