Geeksharka Posted January 31, 2004 Share Posted January 31, 2004 Hi all, How do I substitute text strings that are _not_ part of a larger text string. For example, if I want to substitute all the 'ark's within a text field with 'arrak' -- I want to make sure the substitution only works on the word 'ark' - but not on for example: 'bark'. In short: bla ark bla should become : bla arrak bla bla ark, bla : should become : bla arrak, bla BUT bla bark bla : should become : bla bark bla I have a feeling this is not difficult -- but I am hitting a wall and figured I'd throw this out there. Thanks, Link to comment Share on other sites More sharing options...
Fenton Posted January 31, 2004 Share Posted January 31, 2004 The Substitute function respects spaces. So Substitute ( field, " ark ", " arrak ") The glitch is if you have sentences with " ark." or " ark?" or " ark," etc., ":", "!". In which case you just have to nest Substitutes: Substitute (Substitute (Substitute ( field, " ark ", "arrak"), " ark.", " arrak."), " ark,", " arrak,") You can use globals for the parameters, so one script will do any word: _gFind _gRepace Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 7385 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