core/refactor/array.js
function nearestCharAfter(char, str, index) {
  // Find the nearest char index before given index. skip white space strings
  // If not found, return -1
  let i = index + 1;
  while (i < str.length) {
    if (str.charAt(i) === char) return i;
    if (!/\s/.test(str.charAt(i))) return -1;
    i += 1;
  }
  return -1;
}
function nearestCharAfter(char, str, index) {
  // Find the nearest char index before given index. skip white space strings
  // If not found, return -1
  let i = index + 1;
  while (i < str.length) {
    if (str.charAt(i) === char) return i;
    if (!/\s/.test(str.charAt(i))) return -1;
    i += 1;
  }
  return -1;
}
function nearestCharAfter ( char , str , index ) { // Find the nearest char index before given index. skip white space strings // If not found, return -1 let i = index + 1 ; while ( i < str . length ) { if ( str . charAt ( i ) === char ) return i ; if ( ! / \s / . test ( str . charAt ( i ) ) ) return - 1 ; i += 1 ; } return - 1 ; }
Similar with nearestCharBefore, but find the char after the given index.
If not found, return -1
@param {string} char - Which char to find
@param {string} str - The string to to search.
@index {number} index - From which index start to find
@
Similar with nearestCharBefore but find the char after the given index . If not found return - 1