I’m writing a function to check that data doesn’t (or does :? ) have newlines or carriage returns within some fields of the source data, and then replacing those ‘characters’ with a space; the job is writing to flat files, hence the need to remove them. I thought using index would pick this data up, but it doesn’t:
if (index($P_Input_string,’|’ ,1) > 0 or index($P_Input_string,’/n’,1) > 0 or index($P_Input_string,’/r’ ,1) > 0)
begin
$L_Output_string = replace_substr_ext( $P_Input_string ,'|',' ',null,null);
$L_Output_string = replace_substr_ext( $L_Output_string ,'/n',' ',null,null);
$L_Output_string = replace_substr_ext( $L_Output_string ,'/r',' ',null,null);
end
else
begin
$L_Output_string = $P_Input_string;
end
end
Am I using index incorrectly, or could (should) I use something else?
(Oh, the | is there because that is the delimter on the files)
Thanks
Mart
martinsmith100 (BOB member since 2009-03-19)