Handles requests to shift a character by the given number of places.

@param string $char
@param int    $shift

@return string
960581
protected function shift($char, $shift)
    {
        $shift = $shift % 25;
        $ascii = ord($char);
        $shifted = $ascii + $shift;

        if ($ascii >= 65 && $ascii <= 90) {
            return chr($this->wrapUppercase($shifted));
        }

        if ($ascii >= 97 && $ascii <= 122) {
            return chr($this->wrapLowercase($shifted));
        }

        return chr($ascii);
    }
35796
function _base256_rshift(&$x, $shift)
    {
        if ($shift == 0) {
            $x = ltrim($x, chr(0));
            return '';
        }

        $num_bytes = $shift >> 3; // eg. floor($shift/8)
        $shift &= 7; // eg. $shift % 8

        $remainder = '';
        if ($num_bytes) {
            $start = $num_bytes > strlen($x) ? -strlen($x) : -$num_bytes;
            $remainder = substr($x, $start);
            $x = substr($x, 0, -$num_bytes);
        }

        $carry = 0;
        $carry_shift = 8 - $shift;
        for ($i = 0; $i < strlen($x); ++$i) {
            $temp = (ord($x[$i]) >> $shift) | $carry;
            $carry = (ord($x[$i]) << $carry_shift) & 0xFF;
            $x[$i] = chr($temp);
        }
        $x = ltrim($x, chr(0));

        $remainder = chr($carry >> $carry_shift) . $remainder;

        return ltrim($remainder, chr(0));
    }
532580
private String getShiftDecimal(long number, int shift) {
        StringBuilder builder = new StringBuilder();
        builder.append(number);

        int index = builder.length() - shift;
        builder.insert(index, ".");

        return builder.toString();
    }
650688
function bitwise_leftShift($shift)
    {
        $temp = new Math_BigInteger();

        switch (MATH_BIGINTEGER_MODE) {
            case MATH_BIGINTEGER_MODE_GMP:
                static $two;

                if (!isset($two)) {
                    $two = gmp_init('2');
                }

                $temp->value = gmp_mul($this->value, gmp_pow($two, $shift));

                break;
            case MATH_BIGINTEGER_MODE_BCMATH:
                $temp->value = bcmul($this->value, bcpow('2', $shift, 0), 0);

                break;
            default: // could just replace _rshift with this, but then all _lshift() calls would need to be rewritten
                     // and I don't want to do that...
                $temp->value = $this->value;
                $temp->_lshift($shift);
        }

        return $this->_normalize($temp);
    }
474038
private static void shiftArray(char [] dest,int start, int e, char subChar){
        int w = e;
        int r = e;
        while (--r >= start) {
          char ch = dest[r];
          if (ch != subChar) {
            --w;
            if (w != r) {
              dest[w] = ch;
            }
          }
        }
   }
74025
public function removeChar(&$txt, &$cOTLdata, $char)
	{
		while (mb_strpos($txt, $char, 0, $this->mpdf->mb_enc) !== false) {
			$pos = mb_strpos($txt, $char, 0, $this->mpdf->mb_enc);
			$newGPOSinfo = [];
			$cOTLdata['group'] = substr_replace($cOTLdata['group'], '', $pos, 1);
			if ($cOTLdata['GPOSinfo']) {
				foreach ($cOTLdata['GPOSinfo'] as $k => $val) {
					if ($k > $pos) {
						$newGPOSinfo[($k - 1)] = $val;
					} elseif ($k != $pos) {
						$newGPOSinfo[$k] = $val;
					}
				}
				$cOTLdata['GPOSinfo'] = $newGPOSinfo;
			}
			if (isset($cOTLdata['char_data'])) {
				array_splice($cOTLdata['char_data'], $pos, 1);
			}

			$txt = preg_replace("/" . $char . "/", '', $txt, 1);
		}
	}
544775
def _shift(tokens):
    """"""
    after = tokens.peek(n=1, skip=_is_comment, drop=True)
    tok = tokens._buffer.popleft()
    return tok[0], tok[1], tok[2], after[0]
703323
public function setCharAt( $position, $character )
	{
		if( $position <= $this->count() && $position >= 0 )
			$this->buffer[$position] = $character;
		return $this->toString();
	}
387141
function (char) {
                var
                    escapeChar = this._escapeChar,
                    count;
                if (char === escapeChar) {
                    count = ++this._escapeCount;
                    if ("-" === escapeChar && 3 === count) {
                        this._output("&mdash;");
                        return this._parseContent;
                    }
                } else {
                    count = this._escapeCount + 1;
                    while (--count) {
                        this._output(escapeChar);
                    }
                    this._setParserState(this._parseContent);
                    return this._parseContent(char);
                }
            }
394472
protected function normalizeCharForKeyEvent($char) {
    if (!is_int($char) && !is_string($char)) {
      throw new DriverException("Unsupported key type, can only be integer or string");
    }

    if (is_string($char) && strlen($char) !== 1) {
      throw new DriverException("Key can only have ONE character");
    }

    $key = $char;
    if (is_int($char)) {
      $key = chr($char);
    }
    return $key;
  }
533106
public function limit($cnt, $shift = 0)
    {
        $data = array_slice($this->get(), $shift, $cnt, true);

        // put data back in generator
        $this->generator = new \ArrayIterator($data);

        return $this;
    }
315078
public static function findCharPosition($string, $char, $start_at = 0)
    {
        $position = strpos($string, $char, $start_at);

        return ($position !== false) ? $position + 1 : null;
    }
723442
public function escapeLiteral($char)
	{
		return (isset($this->inLiteral[$char])) ? $this->inLiteral[$char] : $char;
	}
658000
protected function compileTargetCharacter($char)
    {
        switch (true) {
            case $char === 'remove':
                return function ($matches) {
                    return '';
                };

            case $char === 'keep':
                return function ($matches) {
                    return $matches[0];
                };

            case preg_match('("(?:[^\\\\"]+|\\\\\\\\|\\\\\'|\\\\")*?")', $char):
                $string = str_replace(
                    array('\\\\', '\\"', "\\'"),
                    array('\\', '"', "'"),
                    substr($char, 1, -1)
                );

                return function ($matches) use ($string) {
                    return $string;
                };

            default:
                $char = $this->compileCharacter($char);

                return function ($matches) use ($char) {
                    return $char;
                };
        }
    }
261840
public static function shift($username, $base, $limit = 8)
    {
        if ($username === $base && $limit < strlen($base)) {
            $base = substr($base, 0, $limit);
        }

        $list = array();
        $replacement = self::replace($username, $base);
        $length = strlen($base);

        for ($i = 0; $i <= $length; ++$i) {
            $list[] = substr(sprintf('%s%s%s', substr($base, 0, ($length - $i)), $replacement, substr($base, (-1 * $i))), 0, $limit);
        }

        return array_unique($list);
    }
1203428
private function findPositionOfNextCharacter(array $chars)
    {
        $currentPosition = $this->currentPosition;
        while (true) {
            if ($this->isEOF($currentPosition)) {
                throw new \LogicException(sprintf('Could not find any characters: %s', implode(', ', $chars)));
            }

            // get the next char & advance immediately
            $nextCharacter = substr($this->contents, $currentPosition, 1);
            ++$currentPosition;

            if (\in_array($nextCharacter, $chars)) {
                return $currentPosition;
            }
        }
    }
325412
public static function char2Unicode($char)
    {
        switch (strlen($char)) {
            case 1 :
                return ord($char);
            case 2 :
                return (ord($char{1}) & 63) |
                    ((ord($char{0}) & 31) << 6);
            case 3 :
                return (ord($char{2}) & 63) |
                    ((ord($char{1}) & 63) << 6) |
                    ((ord($char{0}) & 15) << 12);
            case 4 :
                return (ord($char{3}) & 63) |
                    ((ord($char{2}) & 63) << 6) |
                    ((ord($char{1}) & 63) << 12) |
                    ((ord($char{0}) & 7) << 18);
            default :
                trigger_error('Character is not UTF-8!', E_USER_WARNING);
                return false;
        }
    }