Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ASP 3.0  Urgent Help Required Please
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ASP 3.0 Urgent Help Required Please

 Post Reply Post Reply Page  123>
Author
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Topic: ASP 3.0 Urgent Help Required Please
    Posted: 08 December 2007 at 8:37am
I really need it ASAP. Please help me.
 
 
<%
sentence = "My Mail Has Been Deleted"
%>
 
Now i want to make three pieces of this sentence and... want it like this
 
<%
variable1 = "MY"
variable2 = "Mail"
Variable3 = "Has Been Deleted"
%>
 
Note:
All the sentences, i want to edit contains this word "Mail" and i want to break the sentence from where "Mail" Starts and third pieace of the sentence should start with where the "Mail" ends.
 
One more example (just to explain clearly what i want)
 
<%
setence "His Mail is Rubbish"
%>
 
It should be like this
 
<%
variable1 = "His"
variable2 = "Mail"
variable3 = "Is Rubbish"
%>
 
Please help. Thank you.
 
 
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2007 at 8:45am
Very simple to do with asp. You should use the split function.
 
There is a tutorial for this here: http://www.w3schools.com/vbscript/func_split.asp
Back to Top
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2007 at 8:49am
Thanks, yes its very simple but the thing is, i never worked on this function. ok i am checking the site you have just given,
 
If anyone has any idea please post.
 
Thanks jamie, so nice of you.
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2007 at 8:55am

If you are not sure about the length of your sentence then you can use something like this.


Dim SplitWords
Dim Sentence

Sentence = "This is your sentence"
SplitWords = Split(Sentence, " ")

Dim i
For i = 0 to Ubound(SplitWords)
Response.Write SplitWords(i) & "<BR>"
Next
Back to Top
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2007 at 9:02am
this is the result,
 
This
is
your
sentence
 
can u please tell me how do i add "This" in variable1 "is in variable2 and so on
 
 
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2007 at 9:04am
Is there going to be a set amount of variables or will it depend on the length ?
Sorry if I am not clear.
 
Is there going to be 3 variables and thats it or is it possible there will be more ?
Back to Top
mhanif View Drop Down
Groupie
Groupie
Avatar

Joined: 22 November 2007
Location: Pakistan
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote mhanif Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2007 at 9:06am
i think i have done it,, if i succeed, i will post it here okay friend...
 
Thanks once again, it would'nt be easier without ur help (that quickly) Smile


Edited by mhanif - 11 December 2007 at 8:08am
Back to Top
jamie.townsend View Drop Down
Groupie
Groupie


Joined: 07 December 2007
Location: England
Status: Offline
Points: 114
Post Options Post Options   Thanks (0) Thanks(0)   Quote jamie.townsend Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2007 at 9:08am
Nice one !
Back to Top
 Post Reply Post Reply Page  123>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.