Character Count Of A String
I tried the strlen() func but to no avail. I am looping through a record set, if the length of a fields string is above a certain character count, say 50, I want to do one think, less than 50 do another?
View RepliesI tried the strlen() func but to no avail. I am looping through a record set, if the length of a fields string is above a certain character count, say 50, I want to do one think, less than 50 do another?
View Repliessay i have a string that is "hello this is my string and i like it very
much" and i want to insert a newline at every 20th character, how could i go
about doing this?
I'm creating a form and I have a text box that can't be over 90 characters. I've been trying to accomplish two things but I'm afraid it's just out of my reach, technically.
1. I would like to setup some validation that checks to make sure that the text box isn't over 90 characters when the form is submitted.
2. If possible I would like to do one of the following things. Have a live character count that increases in real-time for every character that is entered. I've seen this before but I don't know if it's feasible in my case. If that's not possible then I would like to have a 'check count' button that displays the current character count (including spaces) in the text box....
can someone please tell me how to add the " character to a string
i've already tried:
<%
dim string
string = "something"
string = string & """
%>
string should equal something" but doesn't work ?
What is the best way to check each character within a string?
For doing something like encryption, where you check character 1 and replace
it with a different character.. then check character 2 and replace it with a
different character.... etc.... until completing the string?
Is there something wrong with this statement?
SELECT COUNT(applod.CAT) AS CATSR FROM applod WHERE applod.CAT LIKE '%SR%'
This colum has various values such as 1, 2, SR all I want is the number of records that have the value SR in them. Also are you able to make calulations to recordsets, for example
producta = 20
productb = 30
productc =40
((Sum (producta) + sum (productb) + sum (productc)) / (Sum (productc)))
to give me a percentage?
I have an input text area on a form the max field size in the database is 255 i need to split the string at the 250 caracter?
View Replies View Relatedi have a browse button on a web form that the user can upload images via ftp. the user clicks on the browse button to browse a file on his computer and the text field displays the path - "mycomputerdesktopmyimage.jpg".
i need to get the name of the image and insert the name into my database. so i need to be able to search the string ("mycomputerdesktopmyimage.jpg") and insert all the characters after the last "" which will give me the image name. ive tried just writing out the string in asp (jscript), but it gives me "mycomputerdesktopmyimage.jpg" without all the backslashes.
how do i get those backslashes back into the string? my second question is how do i search for the characters after the last backslash? i know i can use a substring on this, but how can i use it for the last backslash?
I have a page that will display a list of locations from an SQL DB. Users need to be able to sort and/or search these locations by industry
Each location has a 4 character desgnation, the 3rd character of which indicates industry. How do I query the DB in an ASP page to recognize ONLY the third character in the string?
Is it possible to search a string for a upper case character? Here is what I am trying to do:
I have the following string:
Quote: str = "ProjectSectionPlanning"
I'm trying to break this string into:
Quote: str = "Project Section Planning"
I'm passing a unique identifier from page1 to page2 to page3 querried from MS SQL Server. When I pass the value, it puts the value in the curly brackets. (Page1 is for display and Page2 is for edit and Page3 is update edit)
When I go to Page3, it gives me an error saying "Syntax error converting from a character string to uniqueidentifier" {7171B9BD-4599-43D9-9521-3DA583A1BB1A} This is the value and the error page says "id=%7B7171B9BD-4599-43D9-9521-3DA583A1BB1A%7D" It seems tp put "%7B" and "%7D" for "{" and "}". Has anyone seen this?
I'm also passing numbers and text and they don't seem to have this problem, just the unique key.
I'm using Msxml2.ServerXMLHTTP.3.0 to fetch a HTML page on a remote
server. The fetched page is then parsed and the information of interest
is extracted and send to the client browser.
However, the remote server does not specify any character coding in its
headers. If using ResponseText property in ServerXMLHTTP, some
international characters are not decoded correctly. This is due to
ResponseText assuming UTF-8 coding if no character set is specified.
My solution is to use the ResponseBody property which returns the web
page as an array of unsigned bytes. I then convert the data to a string
using the ADODB.Stream method as described here:
http://www.motobit.com/tips/detpg_binarytostring/
The string is then parsed and the required information is pulled out.
This solution works just fine but I wonder if there is some more
efficient (without the need for a byte to string converion) way to
solve the problem.
I'm developing an Asp.NET system to take a CSV file uploaded via the web, parse it, and insert the values into an SQL database. My sticking point comes when I try to split() the string returned by readline() on the file.
The following code snippet works for me:
tokens = "one,two,three,four".Split(",")
for each token in tokens
response.write("<td>"+token+"</td>")
next
However, if I take the next line in the CSV, read using StreamReader.ReadLine on the PostedFile.InputStream, I receive "Object reference not set to an instance of an object." which I have narrowed down to be my string holding the line. Further investigation reveals that no other string member functions work on my line (.ToCharArray, .ToString, etc).
I suspect that StreamReader.ReadLine is not correctly returning a string, even though Response.Write(line) displays what I would expect .....
I have a login form in which i have logins for company as 'National City"
But when i capture the login name to give it in my query on some other form as Request.Querystring(username)
Its recognises it as National%20City...
i dont want to chhange my login names and keep it as NationalCity as one full word.How can i tell ASP to recoginze this as a space in the query ?
How do I delete the last character in a string?
View Replies View RelatedI am using mySQL with ASP. I have a trouble with Turkish characters as I am
tring to get and display data from mySQL database. However, I can see whole
Turkish characters exactly when I use phpMyAdmin.I used the following tags on HTML but I couldn't achieve to display Turkish characters in any way.
mySQL database lang: latin5_turkish_ci
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-9">
and
<% @Language = "VBScript" Codepage="1254"%>
Session.LCID = 1055
Session.CodePage = 1254
We have an application which uses surname and the date of birth to allow people to login.
The SQL gives an error if the user's surname contains the character '
I'm trying to set a session variable where two variables are seperated by a backslash:
Dim a
Dim b
a = Request.QueryString("Class")
b = Request.QueryString("Group")
Session("FTEClassGroup" & y) = a + "/" + b
I can't get this to work? I'm not sure, but is the backslash being seen as a string instead of the actual backslash character?
i m declare one variable and it hold the name of a person
eg: strName = "Arvind Singh"
and i want to put first four character in an other variable please tell me the way to do this.
I have a partner sending me by post method to an asp page some text (xml
string).
It arrives to my page encoded as follows
%9a%2f%Purchaseorder%3....f
The < and > and spaces are replaced by nu霉mbers and percentage sign
I am using Request.BinaryRead(BytesTotal) and then doing response write and
I am getting exactly the same string with the encoding
How can tell my asp page to translate the encoded text to normal text?
How do I remove those special characters in a variable? I think there are a dozen special character and so I use a dozen replace object. Is there an object that call this in one call instead of a dozen?
View Replies View RelatedI wonder why my computer with UK settings returns '$' when I call the 'FormatCurrency' function?
View Replies View RelatedI'm having a problem finding/using an escape character with this ASP/JScript application I'm creating. Basically I have text sometimes that has apostrophes or double quotations in them, but they won't be INSERTED unless I manually take them out.
Ex: INSERT INTO tbl1 (vendor,reason) VALUES (81,"This is only a test, but there is an apostrophe and it's only going to make things worse.")
That apostrophe in "it's" is kiling everything. I've used the replace method to change it to " ' ", but that STILL doesn't work. I can't find MS SQL's ESCAPE CHARACTER. I've tried several directions of the backslash, but no luck.
I am trying to only have a link show if there is a certin value in the DB. This is what I am trying:
<% if (rsWelcome.Fields.Item("access_level").Value) = "admin" then
response.Write("| - <a href="sps_main.asp">Sales Training Support </a>-")
end if %>
BUT... this is the error I get:
Expected ')'
/sta/topnav_test.asp, line 9 response.Write("| - <a href="sps_main.asp">Sales Training Support </a>-") How do I use quotes in a "response" and have the app server ignore them??
The application should have a way of alerting the user if it does not recognize a character used by the website and give the user the ability to make adjustments to the unrecognized characters. The system should then remember the characters that have been adjusted by the user.
View Replies View Relatedhow can I add "vbCrLf" after every 80th character of a string. Suppose there is a string containg 600 characters and I want to pass on the string value to some variable, adding "vbCrLf" code after every 80th character.
View Replies View Relatedsome one cuts and pastes the chinese charcters.
they are saved in DB as
---- case1 : ----
& # 6 5 3 9 6 ; & # 6 5 4 2 7 ; & # 6 5 4 1 9 ;
----
i used the space above as it is converting the characters while posting..
but i noticed some few records which are saved as
-- case 2 --
永乐大典戏文三种校
---
if values are stored as case1 then i have no problem.
but with the case2 .the chinese characters are shown good in few pages and at few pages they are shown as it like symbols.
when i cheked the its the same.what shd i do to see that in a html page these character codes display correctly?
Is there a way to make the underscore Character display in a browser? I've
tried several different fonts but the "_" character will not display.
ive got a string where i woulld like to remove the last character it probably seems simple 2 u but i cant work it out
can anyone tell me how to remove it.
IF trim(request(location))="" AND trim(request(FileType))="" AND trim(request(DateMonth)) = "" AND trim(request(DateYear))="" THEN
Response.Redirect plmsearch.asp?ac=error
END IF
why is the "?" causing the invalid character? everything is coded correctly on the plmsearch.asp page.
I have a ASP/SQL 7 application that displays data from various SQL7 Views
onto a ASP page.
A column of this data is displayed in ASP as hyperlinks and the relevent
data is put into a URL query string - so that the linked page is based on
this data ( a kind of "drill-down" effect) - Code:
I have some text that I recieve from a DB, (it can variable or A text field doesnt metter)No i need to recognize if this text is english or a hebrew.how can i do it?
View Replies View RelatedI have an asp application running with the charset set to windows-1252.Recently, my customer complained about some unknown characters(rectangulars) appeared on the screen.
Later I found out from database that the unknown characters are supposed to be coma (,). I then tried to set the charset in all pages to UTF-8 but it did not solve the problem. I have a problem debuging since my testing machine does not have this problem.Is there a possibility that font selection such as sans-serif can cause this problem?