Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

if[Right(fieldname);1)="^"]

set variable[$header; fieldname]

What I need to do is trim the ^ when I set the variable--

Thus the set variable should look like this--

set variable[$header; ;)??]

If I remember I would use right and trim in order for it to remove the ^. Just can't remember the correct format.

Thansk for you help chuck

Posted (edited)

Set Variable [ $header ; TrimAll ( Substitute ( text ; "^" ; " " ) ; 1 ; 1 ) ]

I do not believe the If[] test is even necessary but this *is* untested. It should remove the ^ no matter where in the field. :wink2:

Edited by Guest
Posted

Any particular reason you're going with TrimAll vs. good old Trim?

Posted

Only one ... it inserts a space between non-Roman and Roman text if there isn't one and it takes no more evaluations so it seems more all inclusive. :wink2:

I tease of course. The most important reason is to remove TWO spaces between. With a strange character such as the caret, I cannot guarantee there aren't extra spaces so I take the extra precaution to remove them.

Posted (edited)

LaRetta: Set Variable [ $header ; TrimAll ( Substitute ( text ; "^" ; " " ) ; 1 ; 1 ) ]

Some of my records I use ^ in more places then at the end. Thus, this solution will not work for me. I know for a fact the ^ will be at the end of the sentence.

eg. the quick brown ^fox jumped over the lazy cat[color:red]^.

[color:red]I just need to remove the ^ after cat. This will always be the case.

For some reason, I think I need to do a right(??) function.

Edited by Guest
Posted

Try:

Left ( text ; Length ( text ) - ( Right ( text ; 1 ) = "^" ) )

This will remove the last "^" (if there is one), and ONLY the last one. If the text ends with "cat^^", only the last "^" will be removed.

This topic is 5940 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.