Tabnine Logo For Javascript
String.indexOf
Code IndexAdd Tabnine to your IDE (free)

How to use
indexOf
function
in
String

Best JavaScript code snippets using builtins.String.indexOf(Showing top 15 results out of 48,762)

origin: cube-js/cube.js

app.use(serveStatic(path.join(__dirname, '../playground'), {
   lastModified: false,
   etag: false,
   setHeaders: (res, url) => {
    if (url.indexOf('/index.html') !== -1) {
     res.setHeader('Cache-Control', 'no-cache');
    }
   }
  }));
origin: codeceptjs/CodeceptJS

function simplifyObject(object) {
 return Object.keys(object)
  .filter(k => k.indexOf('_') !== 0)
  .filter(k => typeof object[k] !== 'function')
  .filter(k => typeof object[k] !== 'object')
  .reduce((obj, key) => {
   obj[key] = object[key];
   return obj;
  }, {});
}
origin: avwo/whistle

result.map(function(name) {
   if (name.indexOf('req.') === 0) {
    name = reqHeaders[name.substring(4)];
    name && reqResult.push(name);
    return;
   }
   return headers[name];
  }).filter(noop)
origin: muicss/mui

/**
 * Check if element has class.
 * @param {Element} element - The DOM element.
 * @param {string} cls - The class name string.
 */


function jqLiteHasClass(element, cls) {
 if (!cls || !element.getAttribute) return false;
 return _getExistingClasses(element).indexOf(' ' + cls + ' ') > -1;
}
origin: parse-community/parse-server

/**
  * Checks if a ISO8601 formatted date contains a timezone component
  * @param pushTimeParam {string}
  * @returns {boolean}
  */


 static pushTimeHasTimezoneComponent(pushTimeParam) {
  const offsetPattern = /(.+)([+-])\d\d:\d\d$/;
  return pushTimeParam.indexOf('Z') === pushTimeParam.length - 1 || // 2007-04-05T12:30Z
  offsetPattern.test(pushTimeParam); // 2007-04-05T12:30.000+02:00, 2007-04-05T12:30.000-02:00
 }
origin: avwo/whistle

https.createServer(options, function(req, res) {
 if (req.url.indexOf('test-remote.rules') !== -1) {
  return res.end('str2.w2.org/index.html file://`(${search.replace(a,b)})`\nstr2.w2.org/index2.html file://`(${query.replace(/a/g,b)})`');
 }
 res.end(JSON.stringify({
  headers: req.headers,
  body: 'test'
 }));
}).listen(config.httpsPort, startTest);
origin: princejwesley/Mancy

source() {
  let value = this.value || '\n';
  let short = <ReplOutputString str={value.slice(0, value.indexOf('\n'))}
   limit={ReplConstants.OUTPUT_TRUNCATE_LENGTH / 2}/>;

  return <ReplOutputCljsSource short={short} source={ReplCommon.highlight(this.value)}/>
 }
origin: axa-group/nlp.js

/**
  * Indicates the index of a given alpha character.
  * @param {Character} c Character to be checked.
  * @returns Index of the character, -1 if is invalid.
  */
 static alphaIndex(c) {
  return XTableUtils.alphachars.indexOf(c);
 }
origin: sx1989827/DOClever

function filterHeader(obj) {
  var o={};
  for(var key in obj)
  {
    if(key.indexOf("-doclever")==-1)
    {
      o[key]=obj[key];
    }
  }
  return o;
}
origin: muicss/mui

/**
 * Check if element has class.
 * @param {Element} element - The DOM element.
 * @param {string} cls - The class name string.
 */


function jqLiteHasClass(element, cls) {
 if (!cls || !element.getAttribute) return false;
 return _getExistingClasses(element).indexOf(' ' + cls + ' ') > -1;
}
origin: muicss/mui

/**
 * Check if element has class.
 * @param {Element} element - The DOM element.
 * @param {string} cls - The class name string.
 */


function jqLiteHasClass(element, cls) {
 if (!cls || !element.getAttribute) return false;
 return _getExistingClasses(element).indexOf(' ' + cls + ' ') > -1;
}
origin: muicss/mui

/**
 * Check if element has class.
 * @param {Element} element - The DOM element.
 * @param {string} cls - The class name string.
 */
function jqLiteHasClass(element, cls) {
 if (!cls || !element.getAttribute) return false;
 return (_getExistingClasses(element).indexOf(' ' + cls + ' ') > -1);
}
origin: Automattic/wp-calypso

/**
 * Returns true if we detect a core Gutenberg comment block
 *
 * @param   {string }   content - html string
 * @returns { boolean } true if we think we found a block
 */
export function hasGutenbergBlocks( content ) {
  return !! content && content.indexOf( '<!-- wp:' ) !== -1;
}
origin: muicss/mui

/**
 * Check if element has class.
 * @param {Element} element - The DOM element.
 * @param {string} cls - The class name string.
 */


function jqLiteHasClass(element, cls) {
 if (!cls || !element.getAttribute) return false;
 return _getExistingClasses(element).indexOf(' ' + cls + ' ') > -1;
}
origin: muicss/mui

/**
 * Check if element has class.
 * @param {Element} element - The DOM element.
 * @param {string} cls - The class name string.
 */
function jqLiteHasClass(element, cls) {
 if (!cls || !element.getAttribute) return false;
 return (_getExistingClasses(element).indexOf(' ' + cls + ' ') > -1);
}
builtins(MDN)StringindexOf

JSDoc

Returns the position of the first occurrence of a substring.

Most used builtins functions

  • Console.log
  • Console.error
  • Promise.then
    Attaches callbacks for the resolution and/or rejection of the Promise.
  • Promise.catch
    Attaches a callback for only the rejection of the Promise.
  • Array.push
    Appends new elements to an array, and returns the new length of the array.
  • Array.length,
  • Array.map,
  • String.indexOf,
  • fetch,
  • Window.location,
  • Window.addEventListener,
  • ObjectConstructor.keys,
  • Array.forEach,
  • Location.reload,
  • Response.status,
  • Navigator.serviceWorker,
  • ServiceWorkerContainer.register,
  • ServiceWorkerRegistration.installing,
  • ServiceWorkerContainer.controller

Popular in JavaScript

  • rimraf
    A deep deletion module for node (like `rm -rf`)
  • mime-types
    The ultimate javascript content-type utility.
  • aws-sdk
    AWS SDK for JavaScript
  • chalk
    Terminal string styling done right
  • http
  • readable-stream
    Streams3, a user-land copy of the stream library from Node.js
  • yargs
    yargs the modern, pirate-themed, successor to optimist.
  • semver
    The semantic version parser used by npm.
  • webpack
    Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand. Support loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now