Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem: Move beginning of a string to the end of the string (forward slash is in the string) 2

Status
Not open for further replies.

borisbe

Technical User
Aug 15, 2005
73
US
I have a title "Beginning / Intermediate Jazz" and I want to move the "Beginning / Intermediate" to the end with a colon before it so I need:

"Beginning / Intermediate Jazz" changed to "Jazz: Beginning / Intermediate"

============
I have in the formula

if instr({title}),"Beginning / Intermediate") = 1

then
ltrim( mid({title},25,len({title})-24) & ": " & "Beginning / Intermediate")

==============

It is changing the title to "/ Intermediate Jazz: Beginning" so I'm thinking the forward slash is causing the problem.

Help is appreciated.


 
I would do a right({title},len({title})-24)) &": Beginning / Intermediate
 
Your formula works if you remove the Close Bracket after {Title} in the first line.

borisbe said:
if instr({title}),"Beginning / Intermediate") = 1

then
ltrim( mid({title},25,len({title})-24) & ": " & "Beginning / Intermediate")

IE, remove the bracket indicated in red

Cheers
Pete
 
Or perhaps even simpler:

Code:
If      Instr({Title},"Beginning / Intermediate") = 1
Then    Mid({Title},26) & ": Beginning / Intermediate"

When using Mid, the length is optional. If omitted it assumes the rest of the string from the starting point.

Cheers
Pete
 
Thanks kray4660 and pmax9999. Both ways worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top