/* Checks whether the stored string starts with given string.

If given argument is not a string or a String instance, an
InvalidArgumentException is thrown.

Returns boolean.

TODO: Examples
7492
public function starts_with ($needle)
	{
		ensure('Argument', $needle, 'is_a_string', __CLASS__, __METHOD__);

		if ($needle instanceof self) {
			$needle = $needle->to_s();
		}

		return 0 === strcmp($this->slice(0, strlen($needle))->to_s(), $needle);
	}
610722
@Override
	public boolean startsWithCurrentPrefix(final String key) {
		lock.readLock().lock();
		try {
			if (getPrefix() != null && key != null) {
				return key.startsWith(getPrefix() + getPrefixDelimiter());
			}
		} finally {
			lock.readLock().unlock();
		}
		return false;
	}
921365
public static boolean startsWithIgnoreCase(String str, String prefix) {
        return (str != null && prefix != null && str.length() >= prefix.length() &&
            str.regionMatches(true, 0, prefix, 0, prefix.length()));
    }
120653
public function startsWith(self $str, MStringComparison $cmp = null){
		
		if($str->isNullOrEmpty()){
			throw new \InvalidArgumentException('$str is empty');
		}
		
		if($str->count() > $this->count()){
			throw new \InvalidArgumentException('$str is longer than $this');
		}
		
		if($cmp === null || $cmp->getValue() === MStringComparison::CASE_SENSITIVE){
			return $this->substring(0, $str->count())->_Value === $str->_Value;
		}
		else{
			return $this->substring(0, $str->count())->toLower()
					->_Value === $str->toLower()->_Value;
		}
		
	}
260042
function(str) {
    var startsWith = !_.isNull(str.match(rOpsHeadRe))
    return startsWith & cons.isLegalSentence(str)
  }
1117028
public function startsWith($string)
    {
        $string = StdObjectWrapper::toString($string);

        $position = $this->stringPosition($string);
        if ($position !== false && $position == 0) {
            return true;
        }

        return false;
    }
461793
protected boolean accept(final int startArgNo, final String buffer, final int len) {
		// 対象引数が-1、または開始引数にlenが満たない場合は該当なしなのでコード補完しない
		return startArgNo != -1 && (buffer.endsWith(" ") && startArgNo <= len
				|| !buffer.endsWith(" ") && startArgNo + 1 <= len);
	}
538609
function(str) {
    return (_.startsWith(str, '"') && _.endsWith(str, '"') && !_.includes(_.trim(str, '"'), '"')) ||
      (_.startsWith(str, "'") && _.endsWith(str, "'") && !_.includes(_.trim(str, "'"), "'"))
  }
537425
function stringStartsWith (str, val, startIndex) {
  var rest = '' + str
  return (arguments.length === 1 ? rest : rest.substring(startIndex)).indexOf(val) === 0
}
496886
function(str, start) {
    return (str.length >= start.length &&
            str.substr(0, start.length) === start);
  }
133036
def _startswith(expr, pat):
    

    return _string_op(expr, Startswith, output_type=types.boolean, _pat=pat)
1049841
public static boolean startsWith(String value, String... prefixes) {
        if (isNotEmpty(value) && isNotEmpty(prefixes)) {
            for (String prefix : prefixes) {
                if (value.startsWith(prefix)) {
                    return true;
                }
            }
        }
        return false;
    }
1339432
def isstring(args, quoted=False):
    """"""
    isquoted = lambda c: c[0]==c[-1] and c[0] in ['"', "'"]

    if quoted:
        check = lambda c: isinstance(c, str) and isquoted(c)
    else:
        check = lambda c: isinstance(c, str)

    if isinstance(args, list):
        return all(map(check, args))
    else:
        return check(args)
275701
boolean startsWith(final Literal literal) {

        // Check whether the answer is already in the cache
        final int index = literal.getIndex();
        final Boolean cached = myPrefixCache.get(index);
        if (cached != null) {
            return cached.booleanValue();
        }

        // Get the answer and cache the result
        final boolean result = literal.matches(myChars, 0);
        myPrefixCache.set(index, result);
        return result;
    }
385807
public Criteria startsWith(String s) {
		assertNoBlankInWildcardedQuery(s, false, true);
		predicates.add(new Predicate(OperationKey.STARTS_WITH, s));
		return this;

	}
480724
public boolean isSentenceStart() {
    return posToken != null && JLanguageTool.SENTENCE_START_TAGNAME.equals(posToken.posTag) && !posToken.negation;
  }
1027701
static function startsWith($string, $startsWith, $caseSensitive = true) {
		$len = self::strlen($startsWith);
		if ($caseSensitive) return self::substr($string, 0, $len) == $startsWith;
		return self::strtolower(self::substr($string, 0, $len)) == self::strtolower($startsWith);
	}