PRobinson87
New Member
- Joined
- Jan 22, 2014
- Messages
- 8
I'm trying to split a String to get, in my case, product name. I am writing the function as a reference to the full string. The strings all start with "SKU-", the Product Name, then product description.
Ex. [TABLE="width: 239"]
<tbody>[TR]
[TD="class: xl63, width: 239"]SKU-123ABC-Doodad
[/TD]
[/TR]
</tbody>[/TABLE]
I can't simply do text to columns because some Product Names contain dashes.
Ex.
SKU-321-ABC-Doodad
|--| |-------| |-------|
Essentially, what I need to do is replace everything before the first and after the last dash with "". The replace for the first is easy, it's finding the last dash and replacing everything after that is difficult.
Anyone have any experience with this?
Ex. [TABLE="width: 239"]
<tbody>[TR]
[TD="class: xl63, width: 239"]SKU-123ABC-Doodad
[/TD]
[/TR]
</tbody>[/TABLE]
I can't simply do text to columns because some Product Names contain dashes.
Ex.
SKU-321-ABC-Doodad
|--| |-------| |-------|
Essentially, what I need to do is replace everything before the first and after the last dash with "". The replace for the first is easy, it's finding the last dash and replacing everything after that is difficult.
Anyone have any experience with this?