chuckcou Posted August 19, 2008 Posted August 19, 2008 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
LaRetta Posted August 19, 2008 Posted August 19, 2008 (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 August 19, 2008 by Guest
Fitch Posted August 19, 2008 Posted August 19, 2008 Any particular reason you're going with TrimAll vs. good old Trim?
LaRetta Posted August 19, 2008 Posted August 19, 2008 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. 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.
chuckcou Posted August 20, 2008 Author Posted August 20, 2008 (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 August 20, 2008 by Guest
comment Posted August 20, 2008 Posted August 20, 2008 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now