Substituting a space for underscore in a character stringHi:
I have a long description of a product that includes a bunch of underscores __ which I don't want. I'd like to replace them with spaces instead.
I've tried using substr(substitute(columnname, "_",""),1, 999) but that just makes the entire field blank.
I've also tried the reverse (substitute(substr....) same problem.
Help!
JMP 17 FWIW.
Automation and ScriptingConsumer and Market ResearchQuality and Process EngineeringWindowsRe: Substituting a space for underscore in a character stringHi, notice that Jarmo's code replaces the underscores with a space character, " ", while your code replaced the underscores with the empty string, "", which was at least part of the problem.
Re: Substituting a space for underscore in a character stringJust using Substitute should be enough (or Substitute Into() depending on what you are doing)
Names Default To Here(1);
str = "aaa________b_c_________________d";
new_str = Substitute(str, "_", " "); // "aaa b c d"