Hello everyone, I’m back… already. Hopefully I’m not too much of a pest, and I hope I can someday repay the help I’ve gotten here.
Anyway, I need to remove characters from the middle of a string. I can’t determine in advance how long the string will be, so I can’t count from the end, but I know how far to count in from the beginning. I need to remove characters 40 through 54. I tried using [php]substr($title, 0, 39);[/php] to count in from the right up to what I want to delete and create a new short string from the first part of the long string. Then I was going to use [php]substr($title, 54)[/php] to start collecting characters just after the section I want to delete, creating a second short string from the last portion of the long string. Then I was going to glue the two strings together.
So basically (shortened)…
original string: abcdefg
new string: ab
new string: fg
new long string: abfg
I have a workaround I can use that involves rewriting other parts of the code, but if there’s an easier solution, can anyone provide a hint? With this problem, I feel like I’m a lot closer going into it than the last one I posted here.
Dave