Home | Advertising Info27 USERS CURRENTLY ONLINE   
PowerASP
   Site Search Contact Us Sunday, April 28, 2024  

  Active InfoActive Info  Display List of Info MembersMemberlist  Search The InfoSearch  HelpHelp
  RegisterRegister  LoginLogin
Classic ASP - Advanced
 PowerASP Code Help Area : Classic ASP - Advanced
Subject Info: Split string A d d  -  P o s tAdd P o s t
Author
Message << Prev Info | Next Info >>
BradSullivan
Newbie
Newbie
Avatar

Joined: April/20/2005
Online Status: Offline
Info: 3
Added: April/20/2005 at 12:33pm | IP Logged Quote BradSullivan

I am trying to split a string in two, at a set distance, but it needs to be between words.  I am able to do a left(string,250) no problem, but it could end up in the middle of a word.
Any easy ideas?
Back to Top View BradSullivan's Profile Search for other info by BradSullivan
 
cwilliams
Admin Group
Admin Group
Avatar

Joined: April/26/2004
Location: United States
Online Status: Offline
Info: 137
Added: April/20/2005 at 4:02pm | IP Logged Quote cwilliams

please explain this better.. I for one am not quite sure what you mean.

how about some example of the strings you are trying to split for starters

 



__________________


Chris Williams
http://www.PowerASP.com
Back to Top View cwilliams's Profile Search for other info by cwilliams
 
BradSullivan
Newbie
Newbie
Avatar

Joined: April/20/2005
Online Status: Offline
Info: 3
Added: April/21/2005 at 12:51pm | IP Logged Quote BradSullivan

Thanks for trying to help, but I figured it out.
I guess I shouldn't have said strings, what I was trying to do is take a whole sentence and split it into two seperate ones, but couldn't have it split in the middle of a word.  I ended up using InStrRev.
Thanks again


Edited by BradSullivan on April/21/2005 at 12:52pm
Back to Top View BradSullivan's Profile Search for other info by BradSullivan
 
jlk3
Newbie
Newbie


Joined: May/12/2005
Location: United States
Online Status: Offline
Info: 1
Added: May/12/2005 at 11:41pm | IP Logged Quote jlk3

Can you post the code you used to split the string between words?

Thanks!

Back to Top View jlk3's Profile Search for other info by jlk3
 
BradSullivan
Newbie
Newbie
Avatar

Joined: April/20/2005
Online Status: Offline
Info: 3
Added: May/13/2005 at 9:34am | IP Logged Quote BradSullivan

If you just want to split a single string like "Full Name" at the space in between, you can do this:

firstname = trim(left(fullname,instr(fullname," ")))
lastname = trim(right(fullname,len(agent)-len(fname)))


What I was trying to do was split a sentence in half, but make sure it wasn't in the middle of a word, which is done with:
left(MyInput,InStrRev( MyInput, " ",2000))
It's like doing a left(MyInput,2000) which returns the first 2000 characters, but the "InStrRev" makes sure its at a space.
You can get the remainder of the sentence using:
right(MyInput,len(MyInput) - InStrRev( MyInput, " ",2000))
Back to Top View BradSullivan's Profile Search for other info by BradSullivan
 

If you wish to make a comment to this info you must first login
If you are not already registered you must first register

  A d d  -  P o s tAdd P o s t
Printable version Printable version

Info Jump
You cannot add new info in this area
You cannot add to info in this area
You cannot delete your info in this area
You cannot edit your info in this area
You cannot create polls in this area
You cannot vote in polls in this area

   Active Server Pages Rule The World
Contact Us  
All artwork, design & content contained in this site are Copyright © 1998 - 2024 PowerASP.com and Christopher J. Williams
Banner ads ,other site logos, etc are copyright of their respective companies.
STATS Unless otherwise noted - All Rights Reserved.

Active Server Pages help tutorial how to ASP Help ASP Tutorials ASP Programming ASP Code - ASP Free CJWSoft ASPProtect ASPBanner ASPClassifieds www.aspprotect.com, www.cjwsoft.com,www.aspclassifieds.com,www.aspphotogallery.com