I need to long string fields. e.g. `val1|val2|....|val300`

I have max char limit and I want to keep whole value field. e.g. I don't want to have - `val1|val2|....|va`

To keep under max char limit, I am using `substr(1, k)`. Now I need last occurrence of `|` .

I can find first occurrence using:

```
df = df.withColumn("COL_1", F.locate('|', F.col('COL'), 1))

```

How to find the last occurrence of `|` in Pyspark?