2019-03-28 15:07:40 -04:00
|
|
|
/**
|
|
|
|
* Replaces line break with an empty space
|
|
|
|
* @param {*} data
|
|
|
|
*/
|
2020-12-23 16:10:24 -05:00
|
|
|
export const removeBreakLine = (data) => data.replace(/\r?\n|\r/g, ' ');
|
2019-03-28 15:07:40 -04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes line breaks, spaces and trims the given text
|
|
|
|
* @param {String} str
|
|
|
|
* @returns {String}
|
|
|
|
*/
|
2020-12-23 16:10:24 -05:00
|
|
|
export const trimText = (str) =>
|
2019-03-28 15:07:40 -04:00
|
|
|
str
|
|
|
|
.replace(/\r?\n|\r/g, '')
|
|
|
|
.replace(/\s\s+/g, ' ')
|
|
|
|
.trim();
|
|
|
|
|
2020-12-23 16:10:24 -05:00
|
|
|
export const removeWhitespace = (str) => str.replace(/\s\s+/g, ' ');
|