Find Position Of A Char In A String
i have a string and want to find the position of the first '-' in it.
example i have :
"RCD-0-183"
I need to output : 0-183
i have a string and want to find the position of the first '-' in it.
example i have :
"RCD-0-183"
I need to output : 0-183
i got a string- for example the word "CodingForums" i want somehow to add randomal char- for example "0", 3 times the output can look like this-
"0C0odi0ngForums" "Co0ding0Foru0ms" "Co0din0gFor0ums" "0CodingForums00"
what is the best way to do this?
Ok, given a string up to any length, lets say 1,000 characters. I want to only display no more than 450 characters, but I want to end the string where a "." is found. In other words, have it go the 450 character, then from that point backwards, find the first "." That will be the end of what is displayed. I don't want hanging sentences in other words...
View Replies View RelatedHow can i count the number of times a string appears within another string.
View Replies View RelatedI have a small script were a variable called "MyURL" is used
MyURL = "/xxx/yyy/zzz/"
Now I want to find it's parrent URL. The result should be
ParrentURL = "/xxx/yyy/"
What is the easiest way to achieve this?
does exist any command to find any substring in a string ? for example if i want to find if there is any + in a string , how can i do this ? Code:
View Replies View RelatedIf i wanna insert the length more than 10,000 char , How ?
View Replies View Relatedwhat i am trying to do is i have a session called "link" and in that session is a web address "http://www.google.com/" and what i am trying to do is if the last char is a "/" then i want to remove it .
View Replies View RelatedI have a cookie like this:
Request.Cookies("connection")("permission")
with the value: YNNYNNYYYN
how can I get the single chars value? Y, N, N...
I previously had a post on a problem with the Microsoft SQL server, when I was trying to compare a record in the database with an inputed record, if the record in the database was not exactly the same length as the inputed record, it would not match. i.e. user codes = OAK,BRANT,QUYOU etc.
Unfortunately these records have already been made and they vary in length from 2-5 characters. Im programming in VBscript, does anyone know any functions which will rectify this problem?
i've tried the trim function but this has no effect, I could just change the length of the column so that they are all a similar length and thus will all be comparable, however this is certainly not ideal as an id code only two characters long is not unique, some of the records will clash.
I would like to avoid changing all the records as there are 25 different codes for about 10,000 records. im sure there is some code which could accomplish this but ideally I would like to solve the problem at source.
i'm trying to printout normal text from IE using Generic Text Driver
like so:
B10,10,0,1,1,1,100,N,"13123123"
problem is in the printout itself (if i use the print to file to debug)
IE keeps appending char 20 charachter to each line which screws up my
printing (trying to printout to a barcode printer)
is escape char in asp script and how we can encode the url in asp script?
View Replies View RelatedCan someone tell me the maximum character length of a variable passed to an ASP page via a POST form (i.e. not through the querystring)? I read somewhere that said it was 1024 characters but that can't be right.
View Replies View RelatedI have this piece of code in an .asp file. I call this file through a form and I send an email
Set myMail=CreateObject("CDO.Message")
myMail.Subject="my subject"
myMail.From=Request("email")
myMail.To="myemail@mail.com"
Dim Body
Body = Body & "Name: " & Request("name") & VbCrLf
Body = Body & "E-mail: " & Request("email") & VbCrLf
Body = Body & "-----" & VbCrLf
Body = Body & Request("the_message") & VbCrLf
myMail.TextBody=Body
myMail.Send
set myMail=nothing
The problem is when I try to fill in the form with greek characters. They appear in the email as ????? or very confused characters with no recovery.
I have one field char type data length 1.. It has data either 1 or 2 in all the field tht I have checked through enterprise manager.
I'm running query:
"select * from table" and fetching all the records and displaying...
It display all the data except data from this field..Doesnt display anything..
I had put Response.write rs("fieldname")
What could be the problem?
I'm querying a table and the column has 6 positions. I need to check if the 5th position is a 2,3,6 or 7. If so I want to set a variable = "Y". Can someone help me out with this?
View Replies View RelatedI am using position feature for images...although its placing the image on the HTML file using the top left corner of the image. Anybody know how to make it use the center of the image?
<img src="image.gif" style="position: absolute; left: 54; top: 34">
I have a access db and I want to pull some info out of it with VBScript. How can I specify a starting record?For example, I want to start at the 15th record and pull everything beyond that out.
View Replies View RelatedWhen a page is opened is there a way to set focus of the cursor to a named input. I want the cursor to be in the input box when the page is opened.
View Replies View RelatedAfter I read in a value from a table i need to read in the last letter of the value and check if it has an "s" as its last letter, so that i can display either ' or 's.
Does anyone know how code to view the last letter of the value or move the variable into javascript so that I can manipulate it from their?
I've just gone to Google and there's a link saying "add world cup live
scores..."
I clicked on that link and there are a whole lot of boxes containing content
that I can pick up and drag around, changing their relative position on the
screen.
Fantastic - but how do they do this (were can I read up on this?)
I have been working on this site for the last couple of weeks and i am now in the process of testing and have found a problem.
Basically it is on my jscript function. I have written that if the value is >= 2000 do something else do something else, which is fine with the exception that the value isn't always going to go up in 1000's (sometimes it will be 1-10 others 500-5000 others 1000 - 10000[these values are generated within select tags]).
Basically i am wanting to know is there any way that i can use the select tag to work out the position from within the tag. For example if the position >= 2nd in list do this else do something else.
I have put serveral panel controls within a page, each of them matching to a action defined by buttons, so I want to fix all panels in one place( they already have same size, but different left, top values), how can I do it (in code, if I do it in desgn, is there a way to put the panels in different "layers" so the contained controls will not interupt with each other)?
View Replies View RelatedI use an array of elements and I want to know the position of a given element in my array
I know the filter function that allows to determine if the element i look for is in the array but this function doesn't allow me to know its position.
how do i find the occurence and position of a variable in a csv string. e.g. how do i find "hello" in hi,who,where,how,hello,greetings,xmas,etc. The starting position and if it occurs ? I tried using instr but cant seem to get it right.
View Replies View RelatedI am having a prob with getting for example, ASP Free Forums > Programming > etc, to display properly. I can get it to work sort of but need to be able to read in a value and be able to change it before its displayed.
It works on the first page but when going to other pages it doesn't. Also when going back to the original page, topic.asp where it works, from view topic the formatting disapears which is a mystery to me. Here is the code that gets it to work on the topic.asp page:section = Trim(Request("Section")) Code:
The code below takes the script name of a page (which is always an asp file) and substitutes the asp extension with html and then inserts the file in the <frame> tag.
This code works file for a url such as www.somesite.com/file.asp But if the url includes an index eg www.somesite.com/file.asp#position1 how do I get the #position1 added to the file name that is used in the <frame> tag? Is there a server variable for # info? Code:
How can I delete an specific position within a vector?I have a list of e-mails to be sent but there's duplicated values which I'd like to remove.I added a function that locates the duplicates and tells the vector position I can find them, but don't have a clue how to remove them.
View Replies View RelatedWe have a page that loads a long list of things. Each row has an onclick where you can open a window for more information. When you do that the parent page refreshes to the top of the page....so if you were near the bottom, you would have to scroll back down to get back to where you were. I would like the parent page to hold its position when the child opens.
View Replies View RelatedIm attempting to grab results from a stored procedure and toss them in a recordset. Unfortunately, I cannot open a recordset that can move forward and backward. I have tried to simply chance the rs.CursorType but this results in a connection timeout..
Code: ....
how to change the ordinal number of a field and the field datatype in Access using ASP?
View Replies View RelatedDoes anyone, know how to control the start-up position of a browser window, such as centre screen, top left, etc....
View Replies View RelatedDoes anyone know how to change the ordinal number of a field and the field datatype in Access using ASP?
View Replies View Related