June 7, 201015 yr Newbies Hi, Im trying to substitute the lower case letter i for the uppercase letter I in a text field. But i only want the letters to be substituted when the letter i is by itself and not in another word. Here is an example: Before: "Hi my name is Ian, i want to substitute text." After: "Hi my name is Ian, I want to substitute text." This is for an email field that will change when a user enters the text manually. I hope that makes sense. Thanks, Ian
June 7, 201015 yr If I'm understanding you correctly, To change the lowercase i to a capital, you can do this using the Substitute Function Substitute (yourField; " i "; " I ") HTH Lee BTW, You can use this on the field directly using the Auto Enter by Calculation, and deselecting the "do not replace..... " Edited June 7, 201015 yr by Guest
June 7, 201015 yr As Lee suggests, Substitute() is probably the way to go here. You could use something like: Substitute ( text ; [" i " ; " I " ] ; [" i." ; " I." ] ; [" i," ; " I," ] ; [ " i'l" ; " I'l" ] ; [ " i'm" ; " I'm" ] ; [ " i'd" ; " I'd" ] ; [color:green][ "i'd " ; "I'd " ] ; [ "i'l " ; "I'l " ] ; [ "i'm " ; "I'm " ] ) Edited June 7, 201015 yr by Guest Added green. Did I miss any? There are probably more clever ways too.
June 7, 201015 yr Hi all there is even another way but it isn't a calculation: it is a script step to add to a button or to fire with an Event plug-in ( if you are really on 9 ) or with a trigger OnObjectExit: Perform Find/Replace [ No dialog; "i" ; "I" ; Replace All ( Direction: All ; Match case ; Match whole words only ; Search across: Current record ; Search within: Current field ) ]
June 7, 201015 yr Hi Daniele, The Replace will change every occurrence of the letter i. Ian was asking to change it only when it was used as a pronoun. Lee
June 7, 201015 yr Hi Daniele, I have never used the script step for find and replace, my habit is to use the Substitute Function, or the Menu Replace. I learned something new today. Thanks for pointing this out. Lee Edited June 7, 201015 yr by Guest
June 7, 201015 yr Thanks, Daniele. I admit that I don't use Perform Find/Replace often; in fact, I've only used it a dozen times in several years. Thanks for the reminder that it should remain in our toolkits. :smile2: Edited June 7, 201015 yr by Guest
June 7, 201015 yr I think that that script step must be revaluated mostly now that we have those beautifull triggers :)
June 8, 201015 yr Author Newbies Hi LaRetta and All, Thanks so much for the fast responses. Your code is exactly what i was looking for. It was the spaces that i forgot in my substitute code when i had wrote it. Something to add to my what not to do list. Thanks for all of the help!!! Best regards, Ian
Create an account or sign in to comment