← substr operator page · string/substr/ds_start/manual_ex_1
pandas ✅ · DuckDB ✅
substr(DS_1, 7): every value of both measures from the 7th character to its end.
Sub-string extraction, Example 1, output verbatim: "If length is omitted or overcomes the length of the input string, the substring ends at the end of the input string."
Me_1 is world, ghilmno and vwxyz; Me_2 is " size text" (with its leading space), text and s a long description.
DS_r:= substr ( DS_1 , 7 );
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 1 | A | hello world | medium size text |
| 1 | B | abcdefghilmno | short text |
| 2 | A | pqrstuvwxyz | this is a long description |
{
"datasets": [
{
"name": "DS_1",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier", "nullable": false},
{"name": "Id_2", "type": "String", "role": "Identifier", "nullable": false},
{"name": "Me_1", "type": "String", "role": "Measure", "nullable": true},
{"name": "Me_2", "type": "String", "role": "Measure", "nullable": true}
]
}
]
}
| Id_1 | Id_2 | Me_1 | Me_2 |
|---|---|---|---|
| 1 | A | world | size text |
| 1 | B | ghilmno | text |
| 2 | A | vwxyz | s a long description |
{
"datasets": [
{
"name": "DS_r",
"DataStructure": [
{"name": "Id_1", "type": "Integer", "role": "Identifier"},
{"name": "Id_2", "type": "String", "role": "Identifier"},
{"name": "Me_1", "type": "String", "role": "Measure"},
{"name": "Me_2", "type": "String", "role": "Measure"}
]
}
]
}