Jump to content

This topic is 5352 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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

Posted (edited)

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 by Guest
Posted (edited)

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 by Guest
Added green. Did I miss any? There are probably more clever ways too.
Posted

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 ) ]

Posted

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

Posted (edited)

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 by Guest
Posted (edited)

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 by Guest
  • Newbies
Posted

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

This topic is 5352 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.