Throws an Exception if next non-whitespace character in input is not the given char

@param string $string
@param int    $pos
@param string $char
@throws TypeConversionException
771052
protected function expectChar(string $string, int &$pos, string $char): void
    {
        if ($char !== $this->nextChar($string, $pos)) {
            throw TypeConversionException::parsingFailed($this, "'{$char}'", $string, $pos);
        }
        $pos++;
    }
356636
public static function getRangeFromPosition(int $pos, int $length, string $text): Range {
        $start = self::getLineCharacterPositionFromPosition($pos, $text);
        $end = self::getLineCharacterPositionFromPosition($pos + $length, $text);

        return new Range($start, $end);
    }
327813
private static String replaceCharAt(String s, int pos, char c) {
		return s.substring(0, pos) + c + s.substring(pos + 1);
	}
46701
private static String scanForName(int pos, final char[] chars) {
      StringBuilder buf = new StringBuilder();
      while(pos < chars.length) {
         char ch = chars[pos++];
         switch(ch) {
            case ' ':
            case ']':
               return buf.toString();
            case '[':
            case '<':
            case '>':
            case '&':
            case '/':
               return "";
            default:
               if(ch < 0x20 || Character.isWhitespace(ch)) {
                  return "";
               } else {
                  buf.append(ch);
               }
         }
      }
      return "";
   }
865833
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setCode($value);
                break;
            case 2:
                $this->setCreatedAt($value);
                break;
            case 3:
                $this->setUpdatedAt($value);
                break;
            case 4:
                $this->setVersion($value);
                break;
            case 5:
                $this->setVersionCreatedAt($value);
                break;
            case 6:
                $this->setVersionCreatedBy($value);
                break;
            case 7:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonFunctionLinkIds($value);
                break;
            case 8:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonFunctionLinkVersions($value);
                break;
        } // switch()
    }
1338812
private function getCharIndex(string $char): int {
        if (\strlen($char) > 1) $char = \substr($char, 0, 1);
        return \ord($char) - \ord('a');
    }
322819
protected void processWhiteSpace(int pos, int endPos) {
        if (scannerDebug)
            System.out.println("processWhitespace(" + pos
                               + "," + endPos + ")=|" +
                               new String(reader.getRawCharacters(pos, endPos))
                               + "|");
    }
1278974
protected static function indexOf($string, $char)
    {
        $pos = @strpos($string, $char);

        return false === $pos ? -1 : $pos;
    }
441391
public function replace($position, $length, $string)
	{
		ArgumentValidator::validateUnsignedInteger($position);
		ArgumentValidator::validateUnsignedInteger($length);
		ArgumentValidator::validateScalar($string);
		if ($position >= $this->length()) {
			throw new \InvalidArgumentException('Position invalid');
		}
		if ($position + $length > $this->length()) {
			throw new \InvalidArgumentException('Length invalid');
		}
		$this->string = mb_substr($this->string, 0, $position) . (string)$string . mb_substr($this->string, $position + $length);
		return $this;
	}
1212667
public Writer setCharacterStream(long pos) throws SQLException {
    int bytePosition = utf8Position((int) pos - 1);
    OutputStream stream = setBinaryStream(bytePosition + 1);
    return new OutputStreamWriter(stream, StandardCharsets.UTF_8);
  }
239651
public static String insert(final String str, final String c, final int pos) {
    if (str.length() < pos) { return str; }
    return str.substring(0, pos - 1) + c + str.substring(pos);
  }
1002655
public static byte decodeHexByte(CharSequence s, int pos) {
        int hi = decodeHexNibble(s.charAt(pos));
        int lo = decodeHexNibble(s.charAt(pos + 1));
        if (hi == -1 || lo == -1) {
            throw new IllegalArgumentException(String.format(
                    "invalid hex byte '%s' at index %d of '%s'", s.subSequence(pos, pos + 2), pos, s));
        }
        return (byte) ((hi << 4) + lo);
    }
638276
function(token, str, pos) {
			if (!token && this.isWhitespaceVisible && /\s+/.test(str)) {
				var whitespaceStyles = [], start, type;
				for (var i=0; i < str.length; i++) {
					var chr = str[i];
					if (chr !== type) {
						if (type) {
							whitespaceStyles.push([pos + start, pos + i, (type === "\t" ? TAB : SPACE)]);
						}
						start = i;
						type = chr;
					}
				}
				whitespaceStyles.push([pos + start, pos + i, (type === "\t" ? TAB : SPACE)]);
				return whitespaceStyles;
			}
			return null;
		}
298358
private void seekNonWs(final String pattern, final ParsePosition pos) {
        int len = 0;
        final char[] buffer = pattern.toCharArray();
        do {
            len = StrMatcher.splitMatcher().isMatch(buffer, pos.getIndex());
            pos.setIndex(pos.getIndex() + len);
        } while (len > 0 && pos.getIndex() < pattern.length());
    }
9863
private static void checkByte(int ch, int pos, int len) throws IOException {
    if ((ch & 0xc0) != 0x80) {
      throw new IOException(
          GT.tr("Illegal UTF-8 sequence: byte {0} of {1} byte sequence is not 10xxxxxx: {2}",
              pos, len, ch));
    }
  }
1078225
public static String 
    trim( String string, int pos ) 
    {
        int len = string.length();

     	int leftPos = pos;
     	int rightPos = len;
     	
    	for( ; rightPos > 0; --rightPos ) 
    	{
    	    char ch = string.charAt( rightPos - 1 );
    		if( ch != ' '
    		    && ch != '\t' 
    		    && ch != '\n' 
    		    && ch != '\r' ) 
    		{    			
    			break;
    		}
    	}
    	
    	for( ; leftPos < rightPos; ++leftPos )
    	{
    	    char ch = string.charAt( leftPos ); 
    		if( ch != ' ' 
    		    && ch != '\t' 
    		    && ch != '\n' 
    		    && ch != '\r' ) 
    		{    			
    			break;
    		}
    	}
    	
    	if( rightPos <= leftPos ) 
    	{
    		return "";
    	}
    	
    	return ( leftPos == 0 && rightPos == string.length() )? string : 
    	                                                        string.substring( leftPos, rightPos );
    }
801842
public function insert( $position, $string )
	{
		if( $position<= $this->count() && $position >=0 )
		{
			if( $position < $this->pointer )
				$this->pointer = $this->pointer + strlen( $string );
			$left	= substr( $this->toString(), 0, $position );
			$right	= substr( $this->toString(), $position );
			$this->buffer = $left.$string.$right;
		}
		return $this->toString();
	}