How to use the substr function from url

Find comprehensive JavaScript url.substr code examples handpicked from public code repositorys.

411
412
413
414
415
416
417
418
419
420
while (imageMatch = imageRe.exec(content)) {
    const url = imageMatch[1];
    const inlineImageMatch = /^data:image\/[a-z]+;base64,/.exec(url);

    if (inlineImageMatch) {
        const imageBase64 = url.substr(inlineImageMatch[0].length);
        const imageBuffer = Buffer.from(imageBase64, 'base64');

        const imageService = require('../services/image');
        const {note} = imageService.saveImage(noteId, imageBuffer, "inline image", true, true);
fork icon0
star icon0
watch icon234

+ 11 other calls in file