Splitting A String To Use Separate Words
i have a search form that will only search the whole string when
searching a query. i would like to have the search string split into
separate words so that each word could be used as part of a single
query. is there a simple solution to my question ?
View Replies
ADVERTISEMENT
I have data where first and last name are in one field. I need help
how to i separate first and last name in ASP.
View Replies
View Related
I need to get data from a string that is like:
2_1
34_1
126_3
I need the numbers on the left in one string and then the numbers on the right that needs to be in a separate string.
View Replies
View Related
I have a var with the value of ADED I want to be able to break this var into an array of 4 elements, or it could be three, depending on the value of the variable.
I tried the following but got nothing.
Code:
dim strVar, arrVar
strVar = Request.QueryString("strVar")
arrVar(0) = Left(strVar, 1)
arrVar(1) = Mid(strVar, 2, 1)
arrVar(2) = Mid(strVar, 3, 1)
arrVar(3) = right(strVar, 1)
When I try to response.write(arrVar(2)), i get nothing. What am I doing wrong?
View Replies
View Related
i get the querysting like this:
www.abc.com?email=abc@abc.com phone=33333333
Now i want to split this string so that i can just pass the phone number to the variable in my program so that the fax gets going.
Can you please let me know how i can split this string and just get the phone number to be passed to the variable ,so that i can initialte the next function of send fax?
View Replies
View Related
I've made my first ASP website that interacts with a detabase. All fairly standard: it can display the entire contents of the db, you can input new items, update and delete items, and I've just started making a search page...[!]
It all works fine if the user just searches with one word, but if they enter more than one word and then press search, I don't know how to split their searchstring up into [an array of?] different strings to search the db with.
Is this even the easiest way to do it, or am I just wasting my time?
View Replies
View Related
I am taking a field from a database and attaching it to avariable like so:
varID = rsCheckLogin("LogonID")
This is returning, for example, SA70.
I only need the integer part. How would i remove the SA part, i have belive it must be trim or split but not sure how to use them?
View Replies
View Related
I have a very long string statement that needs spltting down into smaller sections and segments. I know how to use the split() function, and it splits the string down into smaller sections, however when I try and split one of these smaller sections into segments it throws an error out. Firstly is it possible to keep splitting the same string again and again to break it down? If not does anybody know how I would go about breaking down the string?
View Replies
View Related
Let's say I have the following var:
Code:
strTemp="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed"
and I am searching the string for another string 'amet', for example. How would I go about getting my page to output the word I search for and say 10 chars to the left and 10 to the right? So, in this case, I'd like to be be able to search the string with any
other string ['amet' for example] and have it output this:
Code:
...dolor sit amet, consecte...
View Replies
View Related
I have these strings which are pulled from a database which contains both
english and chinese characters(big5).
e.g.
Fragrant Rice 10kg Green Dragon?
Broken Rice 10kg G.Elephant?
I want to split the string at the first occurance of the non ascii character so that i can get the english and chinese parts separated.
View Replies
View Related
i want to split a string containing unicode chars. If i use Split() funtion of ASP the unicode characters in string it gives wrong results..
Is there any other funtion or anyway through which i can split my unicode string to array?
HERE IS THE EXAMPLE FOR MY PROBLEM ------
i hav string in given form(sepated by a semi colon[;] )
ROOMS = Cap-Haitien;Gonaives;Jeremie;L’Artibonite;Grand-Gouave;
When i split this string using
Split(ROOMS, ";")
it gives me following results
Cap-Haitien
Gonaives
Jeremie
L’
Artibonite
Grand-Gouave
However it shud give me
Cap-Haitien
Gonaives
Jeremie
L’Artibonite
Grand-Gouave
Is there any solution to my problem?
View Replies
View Related
how to capitalise all words in a string that are seperated by spaces. The string is variable and not the same every time hence I cant use the Ucase function as I wont know the exact position of the start of each word.
View Replies
View Related
I'm really at wits end on this as I'm not having much success with locating a function or other options I have. I'm working on a message board for a website and I'm needing to check the length of the words that users put in.
For example, when someone puts in "yesssssssssssss!", I put together a small function that omits all of the s's as this is wreaking havoc on the layout of tables within the site. But I don't have a solution if someone types in "ssss sasdfjskldjfaskld;jfaskdf" as random ambiguous letters.
I know I can check the length of the entire string but don't know to check the words
within it.
View Replies
View Related
I need to parse a long string into no more than 30 character chunks, but I also need to leave the words intact. Right now, I am using:
For intStart = 1 to Len(strOriginal) by 30
strPrint = Mid$(strOriginal, intStart, 30)
Print #detailFile, Tab(1), intStart, Tab(4), strPrint
Next intStart
and it's fine, but splits up some of the words. If I could figure out how to find the preceding space of the 30 limit, I'd be in good shape.
View Replies
View Related
a source code regarding a search code like what the big G and Y did on their search box?
say searching two keyword separating with a comma?
using this doesn't help much
Quote: "SELECTfield_1, field_2 FROM table where field_1='" & keyword & "'" & " order by field_2"
View Replies
View Related
I have a single asp page (index.asp) with an include file (include.asp). I would like to query the database with index.asp as well as query it with include.asp.
I searched online, in my "SAMS Teach yourself active server pages 3.0 in 21 days" and it makes no mention of two queries on a single page. Is this even possible?
View Replies
View Related
Ive some records with the same ID on my DB, for example:
ID Name
1 John
1 Paul
1 Anna
2 Susan
2 George
What I'd like to know is how can I list them separated by ID. For example:
REGISTRIES WITH ID 1
-John
-Paul
-Anna
REGISTRIES WITH ID 2
-Susan
-George
View Replies
View Related
i have this css file.
default.css
Code:
#navcontainer ul
{
margin: 0;
padding: 0;
list-style-type: none;
}
when i put both codes at 1 file, everything are ok, but when i separeted them into different files, nothing happened. what's wrong with the code?
View Replies
View Related
I am developping a web-based file browser. Everything so far so good right now.
To make the userinterface more conveniant, I want to split my file list in
pages. with
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = oFSO.GetFolder(CurrentPATH)
Set oFolderContents = oFolder.Files
For Each oFileItem in oFolder.Files
(...)
Next
I get a list of all my files in oFolderContents. Is there a easy way to
-split the whole list up in pages of i.e. 20 files
-show general info (i.e. xxx files in folder, listing 20 files on page y/z)
-let the user have the possibility to call the page with index i, where i
stands for the i-th file on the list
any good links out there?
View Replies
View Related
I was wondering is there is a way to neaten up or rather seperate the main layout and the asp codes? For example, to have a main.asp(which is solely the design and layout) and include other .asp files that retrives and records the records.
View Replies
View Related
i need to convert some existing templates into ASP, and have come across a stumbling block (which is probably only due to my complete lack of knowledge of all things ASP related ):
is it possible to include files held on a completely separate domain ? the standards include statement only seems to have file and virtual capabilities, and nothing comparable to php's capability of doing something like Code:
include('http://www.someotherdomain.com/includes/somefile.html');
could anybody enlighten me with some workable code ?
View Replies
View Related
How can I correct an address if the user forgets a space between the number and street name? For example, "1600Main Street" would be corrected to "1600 Main Street".
Is there a way to go step by step from the left and enter a space if I hit a letter or stop if I hit a space?
View Replies
View Related
I have a table with a number of 'advertisements', and each ad specifies a page display location (#1 - #9). I would like to query for all ads, but display them only where they have their location (see image above). I currently have 9 different SQL queries, one for each location:
"SELECT * FROM tb_ads WHERE f_adlocation = 1
I would like to have one query, and at location 1, simply say: "If f_adlocation = 1, then display here. If there is more than one, then repeat as necessary". Here is what my database looks like: I have attached sample data as a .txt file.
View Replies
View Related
I have two sites on my computer. I am using a same page in the two sites.
I set my IE to Korean (testing purpose) encoding for testing
internationalization.
When I hit the same page in two separate sites, one shows the foreign
characters in Korean, but the other shows garbage-looking characters.
I am using the exactly the same page.
View Replies
View Related
if there's a better way to seperate my asp code from the main layout? like to have an index.asp(solely the layout and design) and just include other .asp files to display the records.
View Replies
View Related
I am having a problem with getting my date to display in the format needed. The date is being called up from a database in the form of the date and time but I need to have the them both seperate from each other. Its for a message board app I'm currently developing. I've tried various methods but none have worked so far. I am using this code at the moment:
<%Response.Write FormatDateTime(sectionRS("MesDate"), vbGeneralDate)%>
The result comes out the same as if no formatting is used. Do I need to create a variable for the value being called up from the database?
View Replies
View Related
I have a string that looks like this: a|b|c|d%e|f| ...
I split once on "%"
ar1 = Split(Mystring, "%")
then when I try and split the ar1 by
ar2 = Split(ar1, "|")
I get error '800a000d' Type mismatch
I have tried
ar2 = Split(Cstr(ar1), "|")
How can I split this string?
View Replies
View Related
i need to write a query that splits forname and surname that are held in the same col of a db eg old form requested for name(so users just put sarah smith)
but I have added another col forname in the db and the forms now collect forname and surnane into seperate field but I have to now split the old data and put ot into the separate fields can anyone point me in the right direction.
View Replies
View Related
Pretty basic but I cannot figure it out.
Column:
FULLNAME (lname, fname)
Needs to be
FNAME
LNAME
Should split at the comman.I already have all the columns created; just
need to SQL command to make it happen.
View Replies
View Related
I have this SELECT box which allows users to select multiple items to delete... however if they select 2 or more items... the values get passed over as 'one, two' so the sql looks like Delete From Table Where Field='one, two';
How do i do it in such a way that it becomes:
Delete From Table Where Field='one';
Delete From Table Where Field='two';?
View Replies
View Related
I have a variable that stores an amount of time in '00:00:00' format. It is a varchar in the database.
Is there a way to Split the value into hours, minutes, and seconds so I can add them?
I figure it would look something like
xx*60 + xx*60 + xx*3600? Or something like that?
View Replies
View Related
Has anyone had the misfortune to try and split a querystring that has x duplicate name/value pairs within the querystring? I have tried every sort of combination to do this and it continues to just run through the whole querystring.
here is an example querystring
URL
The Address values, email values, title values are fine as they are named on the previous page. The problem is, the L1, L2, L3, L4, L5 etc are dynamically named from a db depending on what the user selects on a previous page and can be duplicated up to 6 times, depending on how many different locations they have. I am able to get all the values at once, but need to be able to split the duplicated name/value pairs as they at seperate locations.
so what i need to be able to do is
Location 1
L1 - 0
L2 - 1
L3 - 0
L4 - 0
L5 - 0
Location 2
L1 - 0
L2 - 2
L3 - 2
L4 - 0
L5 - 0
View Replies
View Related
This is the code I have so far:
I take the email address and split at the "@" symbol. Then I split at the "." sign to get the firstname and lastname.
Most of the times, the email address is of the format:
FirstName.LastName@company.com
However at times, the email address can be just firstname@company.com
At such instances the code fails, how do I check for the instance of . before I split it again?
View Replies
View Related