Jump to content

Recommended Posts

Posted (edited)

Hi everyone,

I'm currently working on a project that involves heavy string manipulation, where I am working with large datasets. There I need to match specific patterns, modify the matches, and then replace the changes back into the string.

I am already mixed the use of StringReplace and StringRegExpReplace, depending where either one is fater (determined that for most of the cases once). Also I am using the case-sensitivity flag/replace count where possible. I tried to also use CLR and calling a C# hoping that that would be faster, but with the overhead it is only faster in some cases.

Are there any other tipps that I can use?

Edited by IronFine
Posted

There is not much you can do using standard String* functions.  Most of them (when modifying the original string) makes a copy of the string.  With small strings, it is not a big deal.  But when it comes to large strings, it can be quite lengthy to execute multiple string operations over a single string.

One method would be to perform in place replacements.  That is quite easy if you replace N characters with some other N characters.  Also it depends where the strings are coming from and where they go (text files ?).  Do they have known formats they are following (like json or xml) ?

Best way to help you, would be for you to provide a real life example, so we can try to look into a solution tailored to your situation.

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...