Last 4 chars ( from right end)
With optional parameter lengthLet us add number of chars we will get by adding length
Starting from 3rd position 5 chars to be collected
Starting from end, from 6th position 2 ( length) chars to be collected
Using FROM to get part of stringRest of the string from a position
From right ( end ) starting from 7 position return 3 chars (length)
Removing Last one char
Use this code in our student table.
Substring and substring_indexSubstring returns part of string by taking position ( number ) as input. If the position is not known and to use a specific delimiter for searching, then substring_index function can be used.
This article is written by plus2net.com team. https://www.plus2net.com
▼ More on String