Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
Thread: Split words
09-26-2007, 07:03 PM #1
In general when we split words we use:
xwords= split(ywords," ")
But, using a table, for example, tableA, where there is a column named "names" where the strings are single words. As I split each word in this way:
Thanks in advance,
09-26-2007, 08:02 PM #2
- Join Date
- Dec 2002
- Arlington, Texas USA
- Thanked 8 Times in 8 Posts
Were you meaning to ask a question?
09-26-2007, 10:13 PM #3
- Join Date
- Mar 2007
- Thanked 19 Times in 19 Posts
I think his question is, how do you split a word based on certain number of letters.
Silly question -- WHY would you ever want to do this?
But, I digress - You would need to use many different functions to accomplish this task:
3) FOR NEXT loop
This works, although that is based on whether or not I am correctly interpreting your question:
Code:<% function splitLetters(strWord) letterCount = len(strWord) ' for x=1 to letterCount-1 if Eval(x/2) = Eval(2/x) then strWord2 = strWord2 & mid(mid(strWord,x,2),x-1,3) & "," else strWord2 = strWord2 & mid(strWord,x,2) & "," end if next ' splitLetters = left(strWord2,len(strWord2)-1) end function %> <p>Night: <%= splitLetters("night") %></p> <p>Achieve: <%= splitLetters("achieve") %></p> <p>Astronomy: <%= splitLetters("Astronomy") %></p> <p>Coding: <%= splitLetters("Coding") %></p> <p>Forums: <%= splitLetters("Forums") %></p> <p>luigicannavaro <%= splitLetters("luigicannavaro") %></p> <p>miranda: <%= splitLetters("miranda") %></p> <p>Daemonspyre: <%= splitLetters("Daemonspyre") %></p>
Things you have to watch out for: SPACES, Case SeNsItIvItY, NULL values, Empty strings.
Please, if you found my post helpful, pay it forward. Go and help someone else today.To say my fate is not tied to your fate is like saying, 'Your end of the boat is sinking.' -- Hugh Downs
09-27-2007, 02:18 PM #4
Thanks a lot!
Yes, it is possible do a lot of things using these functions.
The script works fine and works like I want.
10-08-2007, 12:25 AM #5
So how about thanking him for this helpfull post?
I'm sure he'd like that
Users who have thanked BarrMan for this post: