Skip to content

Commit

Permalink
feat: changed splitStringOnEnter function
Browse files Browse the repository at this point in the history
  • Loading branch information
sedghi committed Dec 22, 2023
1 parent 490d740 commit 3095d15
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Sources/Rendering/OpenGL/ImageMapper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@ function computeFnToString(property, pwfun, numberOfComponents) {

function splitStringOnEnter(inputString) {
// Split the input string into an array of lines based on "Enter" (newline) characters
const lines = inputString.split('\n');

// Remove any leading or trailing whitespace from each line and filter out empty lines
const trimmedLines = lines
.map((line) => line.trim())
.filter((line) => line.length > 0);

const lines = inputString.split('\n');
const trimmedLines = [];
for (let i = 0; i < lines.length; ++i) {
const trimmedLine = lines[i].trim();
if (trimmedLine.length > 0) {
trimmedLines.push(trimmedLine);
}
}
return trimmedLines;
}

Expand Down

0 comments on commit 3095d15

Please sign in to comment.