vbscriptnewlinelf

Replacing vbCrLf with vbLf


I have a a paragraph of text that is sent in with an Lf tag for new lines separating parts, when this is being processed the Lfs end up as CrLF. My issue is that this data is being trimmed down to 4095 characters(database defined char limit) and the vbCrlf seems to be recognized as 1 single character(I did counts before and after the trimming) but 2 distinct characters outside of vb. So for each vbCrLf instance I end up with and extra character more than the supposed limit. I've tried replace the character but I seem to only be able to remove the Lf and attempting to remove the Cr doesn't seem to work. Does anyone have any idea on how I'd be able to remove the Cr and keep the Lf?


Solution

  • You can use the VBscript replace function to remove the Cr. It should work fine

    Replace(TEXT,vbCrLf, VbLf)