at

@param string $string
@param int    $pos
@param string $encoding

@return string
6848
public static function getChar($string, $pos, $encoding = null)
    {
        $encoding = $encoding === null ? mb_internal_encoding() : $encoding;

        if (Mbstring::strlen($string, $encoding) < abs($pos)) {
            return '';
        }

        return Mbstring::substr($string, $pos, 1);
    }
1145488
protected function stringsMatch(array $strings, $pos)
	{
		$value = $strings[0][$pos];
		foreach ($strings as $string)
		{
			if (!isset($string[$pos]) || $string[$pos] !== $value)
			{
				return false;
			}
		}

		return true;
	}
997332
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setSenderlogin($value);
                break;
            case 2:
                $this->setReceiverlogin($value);
                break;
            case 3:
                $this->setTransactionid($value);
                break;
            case 4:
                $this->setBillid($value);
                break;
            case 5:
                $this->setAmount($value);
                break;
            case 6:
                $this->setMessage($value);
                break;
            case 7:
                $this->setStatus($value);
                break;
            case 8:
                $this->setDatetime($value);
                break;
        } // switch()

        return $this;
    }
117535
public int setString(long pos, String str) throws SQLException {
    int bytePosition = utf8Position((int) pos - 1);
    super.setBytes(bytePosition + 1 - offset, str.getBytes(StandardCharsets.UTF_8));
    return str.length();
  }
308790
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setLocale($value);
                break;
            case 2:
                $this->setLabel($value);
                break;
        } // switch()
    }
757331
public static function last($string, $length = 1, $encoding = null)
    {
        if ($string === '' || $length <= 0) {
            return '';
        }

        $encoding = $encoding === null ? mb_internal_encoding() : $encoding;

        return Mbstring::substr($string, -$length, null, $encoding);
    }
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()
    }
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);
    }
661421
private function strAdd(string $str, string $insertstr, int $pos):string
    {
        $str = substr($str, 0, $pos) . $insertstr . substr($str, $pos);
        return $str;
    }
1205437
public int putUTF8(int pos, String s) {
		ByteBuffer minibb = null;
		
		CharsetEncoder enc = getUTF8Encoder();
		CharBuffer in = CharBuffer.wrap(s);
		
		int pos2 = pos;
		ByteBuffer bb = getBuffer(pos2);
		int index = pos2 % _bufferSize;
		bb.position(index);
		
		while (in.remaining() > 0) {
			CoderResult res = enc.encode(in, bb, true);
			
			//flush minibb first
			if (bb == minibb) {
				bb.flip();
				while (bb.remaining() > 0) {
					putByte(pos2, bb.get());
					++pos2;
				}
			} else {
				pos2 += bb.position() - index;
			}
			
			if (res.isOverflow()) {
				if (bb.remaining() > 0) {
					//exceeded buffer boundaries; write to a small temporary buffer
					if (minibb == null) {
						minibb = ByteBuffer.allocate(4);
					}
					minibb.clear();
					bb = minibb;
					index = 0;
				} else {
					bb = getBuffer(pos2);
					index = pos2 % _bufferSize;
					bb.position(index);
				}
			} else if (res.isError()) {
				try {
					res.throwException();
				} catch (CharacterCodingException e) {
					throw new RuntimeException("Could not encode string", e);
				}
			}
		}
		
		adaptSize(pos2);
		return pos2 - pos;
	}
598072
protected function parseLongForm($pos)
	{
		$pos = $this->text->indexOf($this->syntaxChar . '(', $pos);
		if ($pos === false)
		{
			return;
		}

		preg_match_all($this->longRegexp, $this->text, $matches, PREG_OFFSET_CAPTURE, $pos);
		foreach ($matches[0] as list($match, $matchPos))
		{
			$matchLen = strlen($match);

			$this->parser->addTagPair($this->tagName, $matchPos, 2, $matchPos + $matchLen - 1, 1);
			$this->text->overwrite($matchPos, $matchLen);
		}
		if (!empty($matches[0]))
		{
			$this->parseLongForm($pos);
		}
	}
707037
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setTitle($value);
                break;
            case 2:
                $this->setDescription($value);
                break;
            case 3:
                $this->setUrl($value);
                break;
            case 4:
                $this->setThumbUrl($value);
                break;
            case 5:
                $this->setSkillId($value);
                break;
            case 6:
                $this->setPhotographer($value);
                break;
            case 7:
                $this->setPhotographerId($value);
                break;
            case 8:
                $this->setAthlete($value);
                break;
            case 9:
                $this->setAthleteId($value);
                break;
            case 10:
                $this->setUploaderId($value);
                break;
        } // switch()

        return $this;
    }
801209
private function readRangeBound(string $string, int &$pos): ?string
    {
        $bound = null;
        while (true) {
            switch ($string[$pos]) {
                case ',':
                case ']':
                case ')':
                    break 2;

                case '"':
                    if (!preg_match('/"((?>[^"\\\\]+|\\\\.|"")*)"/As', $string, $m, 0, $pos)) {
                        throw TypeConversionException::parsingFailed($this, 'quoted string', $string, $pos);
                    }
                    $pos   += strlen($m[0]);
                    $bound .= strtr($m[1], ['\\\\' => '\\', '\\"' => '"', '""' => '"']);
                    break;

                default:
                    if (!preg_match("/(?>[^\"\\\\\\]),]+|\\\\.)+/As", $string, $m, 0, $pos)) {
                        throw TypeConversionException::parsingFailed($this, 'unquoted string', $string, $pos);
                    }
                    $pos   += strlen($m[0]);
                    $bound .= stripcslashes($m[0]);
            }
        }

        return $bound;
    }
346695
public function getByPosition($pos)
    {
        switch ($pos) {
            case 0:
                return $this->getId();
                break;
            case 1:
                return $this->getCode();
                break;
            case 2:
                return $this->getDriverCode();
                break;
            case 3:
                return $this->getTitle();
                break;
            case 4:
                return $this->getSerializedConfiguration();
                break;
            default:
                return;
                break;
        } // switch()
    }
1312571
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setFirstName($value);
                break;
            case 2:
                $this->setLastName($value);
                break;
            case 3:
                $this->setCreatedAt($value);
                break;
            case 4:
                $this->setUpdatedAt($value);
                break;
            case 5:
                $this->setVersion($value);
                break;
            case 6:
                $this->setVersionCreatedAt($value);
                break;
            case 7:
                $this->setVersionCreatedBy($value);
                break;
            case 8:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonTeamLinkIds($value);
                break;
            case 9:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonTeamLinkVersions($value);
                break;
            case 10:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonImageIds($value);
                break;
            case 11:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonImageVersions($value);
                break;
            case 12:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonFunctionLinkIds($value);
                break;
            case 13:
                if (!is_array($value)) {
                    $v = trim(substr($value, 2, -2));
                    $value = $v ? explode(' | ', $v) : array();
                }
                $this->setPersonFunctionLinkVersions($value);
                break;
        } // switch()
    }
1011578
public function setByPosition($pos, $value)
    {
        switch ($pos) {
            case 0:
                $this->setId($value);
                break;
            case 1:
                $this->setType($value);
                break;
            case 2:
                $this->setName($value);
                break;
            case 3:
                $this->setDomain($value);
                break;
            case 4:
                $this->setApiUrl($value);
                break;
            case 5:
                $this->setApiAuthHttpUser($value);
                break;
            case 6:
                $this->setApiAuthHttpPassword($value);
                break;
            case 7:
                $this->setApiAuthType($value);
                break;
            case 8:
                $this->setApiAuthUser($value);
                break;
            case 9:
                $this->setApiAuthPassword($value);
                break;
            case 10:
                $this->setApiAuthToken($value);
                break;
            case 11:
                $this->setApiAuthUrlUserKey($value);
                break;
            case 12:
                $this->setApiAuthUrlPwKey($value);
                break;
            case 13:
                $this->setCron($value);
                break;
            case 14:
                $this->setCustomerId($value);
                break;
            case 15:
                $this->setActivated($value);
                break;
            case 16:
                $this->setNotes($value);
                break;
            case 17:
                $this->setLastRun($value);
                break;
            case 18:
                $this->setIncludelog($value);
                break;
            case 19:
                $this->setPublicKey($value);
                break;
            case 20:
                $this->setWebsiteHash($value);
                break;
            case 21:
                $this->setNotificationRecipient($value);
                break;
            case 22:
                $this->setNotificationSender($value);
                break;
            case 23:
                $this->setNotificationChange($value);
                break;
            case 24:
                $this->setNotificationError($value);
                break;
        } // switch()
    }
370064
function(v, pos) {
			var buffer = [];
			var escaping = false;

			for (var i = 0; i < v.length; i++) {
				var c = v.charAt(i);
	
				if (escaping) {
					switch (c) {
					case "'":
						buffer.push("'");
						break;
					case '\\':
						buffer.push('\\');
						break;
					case '/':
						buffer.push('/');
						break;
					case 'b':
						buffer.push('\b');
						break;
					case 'f':
						buffer.push('\f');
						break;
					case 'n':
						buffer.push('\n');
						break;
					case 'r':
						buffer.push('\r');
						break;
					case 't':
						buffer.push('\t');
						break;
					case 'u':
						// interpret the following 4 characters as the hex of the unicode code point
						var codePoint = parseInt(v.substring(i + 1, i + 5), 16);
						buffer.push(String.fromCharCode(codePoint));
						i += 4;
						break;
					default:
						throw this.error_parsing(pos + i, "Illegal escape sequence: '\\" + c + "'");
					}
					escaping = false;
				} else {
					if (c == '\\') {
						escaping = true;
					} else {
						buffer.push(c);
					}
				}
			}
	
			return buffer.join('');
		}