Trim String

How do i cut the last 4 characters in a string?
I know how to cut the 4 first, but i need to cut the last!
I have a image name like testimage.gif and I want to cut away .

View Replies


ADVERTISEMENT

Trim String And Indexing Server

Ok, I have this code:

For i = startCt To endCt
' Get the document title. If it's blank, set it to "Untitled".
Dim docTitle,path,desc
Dim tObj
Set tObj = results1(i)
docTitle = tObj("title")
path = tObj("vpath")
desc = tObj("desc")
.......

Now, results1 comes from the ms indexing server.

Problem with some of the results is the title is an empty string, so no link.

If I query the catalog in comp mgnmt, no problems.

So, indexing problem or something else.

I can use the path and get the doc name there if empty.

Also, does asp have a string.trim like .net? ....

View Replies View Related

ASP Trim()

i'm having some trouble with the trim function. I have a date 04/18/1982. I want enter the value 1982-04 into the database. The code i'm using is:

strEXPDT = replace(right(left(request.form("Expiration_Date")2)4),"'","''")

View Replies View Related

Trim

I am constantly in need of help, I am back again. I am slowly, slowly getting my page to work. Here is the latest of my queries. I want to automatically make a username by trimming the first character of the first name and taking the entire last name, and putting it in strUserName, I am a little iffy about TRIM (what else is new) rofl. Anyway the user name I want to take the first 3 characters from postal/zip code and the first three numbers from phone number and make the password. Here is what I am thinking of course it doesn't work. BIG SURPRISE!!!

strUserId = Trim(RS("FName"),1) & RS("LName")
strPassword = Trim(RS("PCode"),3) & Trim(RS("Phone"),3)

View Replies View Related

Trim Numbers

I am converting bites to Megabytes in an operation. How would I trim the result to only go to 2 decimal places?ex:

Response.Write(file.FileName & " (" & (file.Size/1048576) & "Mb)<BR>")

View Replies View Related

Using Replace And Trim Together

This should not be this tough but I may be thinking too hard about it.
Here's what I have:

thenames="charles,sam,chris,"

How do I do remove the last comma? I tried using trim and replace
together but couldn't get it.

View Replies View Related

ASP Trim Function?

I'm creating a website that will have a page that lists current news
items. The news items will be stored in a SQL Server database and will
have basically two fields, the date and the news blurb . . . On the
main page of the site, I want to have a box that shows "Current News"
and only pulls the first 7 or so words from the news blurb followed by
a ... [more] where [more] is a link to the current news page.

For example, the database entry may be something like this: Code:

View Replies View Related

Trim Leading

I have a textarea, that when you insert your cursor into it anywhere except for in the very first line, the cursor falls into the second line. When the form is submitted there is a carriage return at the beginning of the text that I'm having trouble getting rid of.

I tried to Trim() the string both before inserting it into the database and when writing it to the page, but apparently that doesn't strip off carriage returns (even though I've read it does.)

View Replies View Related

ASP Trim Function

i need to use the trim function trim("str","?"). How do i remove the "return sign" from a string?

View Replies View Related

Trim Text

how to use ltrim, rtrim to trim the beginning and end of text entries for extra spaces. I was wondering if there is a way to trim extra spaces from WITHIN a text entry.

Example:

change
John and Linda
to
John and Linda

View Replies View Related

Trim Function

I need to select records from table where right part of Field1 = strTest

the table looks like:

Field 1 Field2 Field3
5159-10 2 3
5159-20 6 9
LS5598-20 8 9

strTest=5159 or LS5598 doesn't matter

should be something like "select Field1 from tabTest where " & Right(Field1, 3) & " like " & strTest & "

Obviously I'm wrong somewhere, could anyone tell me where?

View Replies View Related

Trim Whitespace

does anyone know if it's possible to crop whitespace regions from around the edges of an image using Imagemagick?

I have a whole bunch of signature images (as in, people's handwritten signatures) and I'd like to crop them so that there's no whitespace margin around them. I can do the cropping fine, it's just detecting the color regions.

View Replies View Related

Trim All Characters After The First "

I need to do is remove ALL characters after and inc the characters "." found in a variable. i have a variable which holds device with DNS name such as E096064-FWSM2.netdevice.companyname.com

i want the variable to just hold the name E096064-FWSM2 the extension after the first "." can very greatly so i can not specify all possible options as i just do not know what they are going to be.

View Replies View Related

Trim Return Caracter

I make a csv file with values from data base fields . If my value contains a carriage return caracter at the end, a new line is created in my csv file. I tried to replace chr(13) caracter by an empty caracter but it doesn't work, my code is:

Replace(Trim(element.value), chr(13),"")

Do you have any idea to resolve my problem?

View Replies View Related

Trim() Doesn't Work

I cannot figure out why this won't work, but I cannot get the trim() function to work for me. I tried this test code just to see if I could get anything:Code:

<%
String = "This is a string"
response.write String & "<br>"
Trimmed = Trim(String)
response.write Trimmed

And the results are both the same.This is a string.
Can anyone think of any good reason the Trim statement wouldn't be working I cannot think of any other common ASP function that isn't working for me.

View Replies View Related

Trim Request.Form

its ok to use just

Trim(Request.Form("txtFromName"))

or to use both
rTrim(ltrim(Request.Form("txtFromName")))

View Replies View Related

Web Forms / HTTP File Upload / String.Split A StreamReader.ReadLine() String

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 .....

View Replies View Related

String Functions Run On Empty String

I have a form in which several elements are expected to be all digits. Some of those elements can be left empty, but if specified they must be all digits. I have this Sub to edit them: ....

View Replies View Related

Text String To A Interger String

I am pulling info from a sql server By default the query pulls back the inforamtion as text.Therefore when I go to calculate some figures its giving me a type mismatch error.
Is there a function in can call to convert a text string to an integer string using

rstSearch.Fields("name").Value .To pull back the info in a for loop

Error Type:
Microsoft VBScript runtime (0x800A000D)
Type mismatch

View Replies View Related

String Contains ?

If a visitor doesn't put anything in the "Search" text box I'd like them to
be redirected to where they came from before the search form forwarded them
to the search.asp page. Therefore I've put the following at the top of
search.asp to do this.

View Replies View Related

ADO LIKE 'string'

I am trying to search my access database for a string using LIKE and a wildcard.
Example:

Code:

Dim con

con = "SELECT names.* WHERE name LIKE 'sam*'"

For some reason this gives me no results even though I verified there is entries with the word sam in them.

Also tried using % instead of *. Also took out wildcard. I can search for an integer without a problem though, when I try a string, regardless if there's relevant entries I get nothing back at all.

View Replies View Related

SQL String

I am using an SQL statment with a LIKE clause. I am trying to print the actual SQL statement on the screen. However I cannot print a '%' character on the screen. I tried using Chr code and just % outright.

Random variables:
name, rank

Code:

sSQL = "SELECT * from myTable WHERE myField LIKE '" & name & "%'"


It just prints on the screen: (assume name=joe)

"SELECT * FROM myTable WHERE myField LIKE 'joe'"

View Replies View Related

String To Int

i have an object which is a string, (objrs4("points")) how do i convert it into int numbers.

View Replies View Related

String Value

i need requirement for the current assignment Im working on.Part of my assignment I have to saved updated data from a datagrid and put into database. I had everything working, but without option strict and explicit. When I put it on i'm having trouble getting the value out of it.

What I need is to get the value out of the textbox control of a datagrid in edit mode. The value is supposed to be in Item.cells(2).Controls(0) but I have no clue on how to get it out correctly. Ive tried everything but keep getting errors that it cannot be converted to a string.

View Replies View Related

Getting Url From String

the subject that i need to filter the URL from a memo field that having lots of URL in it, like when we post a message with URL www.websourceinfo.com it will become a base url link with click

View Replies View Related

String Contain

I searched google for this (probably easy to solve) problem, but all answerd there did not work hop someone can help me out.In an asp I want to check whether a string contains a " if so the response should be that the "-sign is not allowed.

Elseif InStr(1, username, """) > 0 then Response.Write "-sign is not allowed in the username."

Tried char(34) and /" and """ but none of these options seem to work.

View Replies View Related

Cut Something From A String

I guess this is easy, but I ask anyway.How can I cut 'www.' and '.no' or '.com' from a string?

example input:

www.norway.no
www.somewhere.com

I want this output:

norway
somewhere

How can I do this?

View Replies View Related

String Within Other String

splitted from this thread, I need to dosomething similar i need comare 2 variables. one of them conaints the other variable but have more information

i need compare
a= "red car"
b= "red"

and then i need ask if is b in A then c=b but i dont know how.

View Replies View Related

Hex To String

converting string to hex like so:

for x = 1 to len(source)
target = target & hex(ascw(mid(source,x,1)))
next

How to convert it back to a string?

I got as far as:

for x = 1 to len(source) step 2
target = target & chr("&H" & mid(source,x,2))
next

but this fails with the pound sign (£ - &pound;)

View Replies View Related

Len(string)

This seems like it should be so simple. I would like to create a conditional statement based on the length of a string. The string is a memo field from an Access database. I would like to handle long memos differently from short ones. I'm starting out just by trying to write out the length of the string:

memo = RS("Idea_Note")
Response.Write Len(memo)

I can response.write the memo without trouble, but I get nothing for the length of the memo.

View Replies View Related

String

I have a drop down list of ssn and text box to input ssn to view the info in the next page. I am having a problem with displaying and when I debugged the code, I am getting a comma next to the ssn. Here is my code the dropdown and input type:ssn is text field. Code:

<table>
<tr>
<td>
<Select name=ssn >
<%response.write("<option value=""" & RS("ssn") & """>" & RS("ssn") & "</option>" & vbcrlf)%></td>
<td><input type=text name=ssn value="">
</tr>
</table>

In next page when I response.write ssn, I am getting the ssn as: 123456789, why am I getting a comma next to the ssn?

View Replies View Related

DB String

I got this huge query string that works well if I put something like this:

"select * from table"

in the table, there is a field called result wich is a varchar

so if I write "select * from table where result=" & result it says:

Microsoft OLE DB Provider for SQL Server error '80040e07'
Conversion failed when converting the varchar value 'E' to data type int.

/backoffice/ac_medica/operadores.asp, line 82

I'm gonna need the same for dates later... Can anyone tell me how?

View Replies View Related

Breaking Up A String

I am wondering if any body can guide me on how to break up a string so that i can use the first letter as a querystring.

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved