I have a string variable SET @my_str=,2,4,7,1
and I want to remove the first char (comma). What I tried is SET @my_str=substr(@my_str,1)
but it does not work.
Am I doing something wrong?
答案 0 :(得分:1)
The index is 1-based, so you will need to start at 2:
SET @my_str=substr(@my_str,2)