Sunday, March 14, 2021

OIC - Javascript - to remove carriage return

For instance the method you made could be made more general to parse input from several different types of files. Due to differences in Operating system it is quite common to have files with \n or \r where a new line is required. To be able to handle both your code could be rewritten using some features of regular expressions. 

function removeCarriageReturn(variable){

var newString = "";

var newString =variable.replace(/[\n\r]/g, '');

return newString;

}



No comments:

Post a Comment

Featured Post

OIC - Sorting Unifier UDR Data by Latest Creation Date in OIC Using XSLT

  🔍 Use Case In an Oracle Integration Cloud (OIC) flow, we receive Unifier UDR report rows where the creation date is in MM/DD/YYYY HH:MM ...