javascript intercepts the string between two symbols (2): lastIndexOf match and regular expression match

lastIndexOf matching and regular expression matching project requirements 1. Canonical string 2. Irregular character strings 3-1. Universal package 3-2.Optimized writing of ChatGPT 4. Usage of regular expressions 5. Supplementary knowledge: usage of lastIndexOf Project requirements Intercept the content between the last “/” and “?” in the string in javascript. 1. Standard string https://test.com/p/course/column/p_64a7738ce4b0b0bc2bfcebaa?shareBind=true function extractContent(url) […]

Methods of JS arrays (super detailed, including understanding) push, pop, unshift, shift, splice, slice, concat, join, revres, indexOf, sort, filter, map

A collection of methods in an array will change the original array: (1) The push() method adds one or more new elements at the end of the array and returns the length of the new array. const arr = [1, 2, 3,] arr. push(4, 5, 6) console.log(arr);//[1,2,3,4,5,6] console.log(arr.push(4, 5, 6));//6 (2) The pop() method deletes […]

C# Replace(), Trim(), Split(), Substring(), IndexOf(), LastIndexOf() functions

Directory 1. Replace() 2. Trim() 3. Split() 4. Substring() 5. IndexOf() 6. LastIndexOf() 1. Replace() In C#, Replace() is a string method used to replace a specified character or substring with another character or string. The following are some common usages and sample codes of the Replace() method: Replace one character in a string with […]

[Solved] Search in the el-tree filter box, there is matching data in the tree data, but an error is reported. The indexOf cannot be obtained from the XXX property Cannot read properties of null (reading indexOf’)

【Problem Description】 Search in the el-tree filter box, there is matching data in the tree data, but an error is reported (Error in callback for watcher “filterFrom”: “TypeError: Cannot read properties of null (reading ‘indexOf ‘)”), cannot read indexOf 【Problem Reason】 Let’s take a look at the method of filtering tree data filterNode(value, data) {<!– […]

[Solved] Create Vue project error Error: command failed: yarn, page error Cannot read properties of undefined (reading ‘indexOf’)

Create vue project error: ERROR command failed: yarn The page reports an error Cannot read properties of undefined (reading ‘indexOf’) Solution 1: Win + R and enter cmd to enter the command line interface input the command npm install -g yarn After success, re-create the vue-cli4 project to solve it. Solution two: Go to C:/users/administrator/ […]

[Solved] electron+vue+better-sqlite3 build error: Cannot read property ‘indexOf’ of undefined

Problem description: Recently I made a software, using better-sqlite3 to store data and using vue3 as the front end, and using IPC inter-process communication to simulate ajax requests to achieve front-end and back-end separation. The back-end simply imitates the MVC framework and wrote it again. There is no problem with the back-end testing in the […]