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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing unwanted text

Status
Not open for further replies.

jarla

Programmer
Jan 2, 2001
34
FI
HI!
Is there any way to remove unwanted text from textline. The program I use generates this kind of line:
"/scripts/wrap.exe/NPS-10025.jpg?directArg=idieigspvgujueupspvbipjhij,NPS-10025.jpg"
All what I need is NPS-10025.jpg. Of course that name is different if the customer choose some other picture.
The reason why the program generates so long line, is it´s system to get picture information from server. I want to make an Thank You -page to my customer, where is a text:
"Thank you for your order. Picture name: NPS-10025.jpg..."
 
I change my question:
Now I´ve found a way to count with code how many characters is there before that "," -sign. If the number of characters before that "," sign is, for example, 69, how can I remove those 69 unwanted first characters? After that "," sign is the real picturename what I want.
 
Hey Jarla,

I believe the mid() function is what you're looking for.

<cfset var1=&quot;/scripts/wrap.exe/NPS-10025.jpg?directArg=idieigspvgujueupspvbipjhij,NPS-10025.jpg&quot;>

<cfset fileName = mid(var1,70,len(var1)-69)>

Hope this helps,
GJ
 
Thank you, GunJack! Now I have one extra question, here is my code:

<!--First we find a character &quot;,&quot; and give it a name &quot;pilkku&quot;-->
<cfset pilkku = #REFind(&quot;,&quot;, &quot;#form.item#&quot;)#>
<cfset var1=&quot;#form.item#&quot;>
<cfset filename = mid(var1,#pilkku#,len(var1)-#pilkku#+1)>
<cfloop list=&quot;#filename#&quot; index=&quot;index&quot;>
#index#<br>
</cfloop>

The form what I use generates checkboxes with that same &quot;item&quot; -name with different values. What is wrong with that code, because it changes only first item´s name to short one and all of the other ones stay like on my first message? Is there something wrong with that &quot;loop&quot; thing?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top