Browser Support substring()is an ECMAScript1 (JavaScript 1997) feature. It is supported in all browsers: ChromeEdgeFirefoxSafariOperaIE YesYesYesYesYesYes ❮PreviousJavaScript StringReferenceNext❯ Track your progress - it's free! Log inSign Up...
Works in:From MySQL 4.0 More Examples Example Return a substring of a string before a specified number of delimiter occurs: SELECTSUBSTRING_INDEX("www.w3schools.com",".",2); Try it Yourself » ❮Previous❮ MySQL FunctionsNext❯
Log in Sign Up Get Certified For Teachers Spaces Plus ❯ HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SASS VUE GEN AI SCIPY CYBER...
Extract 3 characters from a string, starting in position 1: SELECTSUBSTRING('SQL Tutorial',1,3)ASExtractString; Try it Yourself » Definition and Usage The SUBSTRING() function extracts some characters from a string. Syntax SUBSTRING(string,start,length) ...
Works in:From MySQL 4.0 More Examples Example Extract a substring from the text in a column (start at position 2, extract 5 characters): SELECTSUBSTRING(CustomerName,2,5)ASExtractString FROMCustomers; Try it Yourself » Example Extract a substring from a string (start from the end, at pos...