nickleplated
asked on
Trim Words Function
I'd like to show the first 25 words from a text field variable.
ie: Return a paragraph but only show the first 25 words.
ie: Return a paragraph but only show the first 25 words.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you can try:
<%
value = "abcdefghijklmnopqrstuvwxy z"
Left(value, 25)
%>
<%
value = "abcdefghijklmnopqrstuvwxy
Left(value, 25)
%>
for a fuller version:
After Submit of your text value:
<%
Dim value
' "txtField" depends on what is your text type name
value = Request.form("txtField")
Response.write Left(value,25)
%>
or you can also use this in the client code
<script language="vbscript">
Sub OnLoad
Dim value
value = "abcdefghijklmnopqrstuvwxy z"
MsgBox Left(value,25)
End Sub
</script>
After Submit of your text value:
<%
Dim value
' "txtField" depends on what is your text type name
value = Request.form("txtField")
Response.write Left(value,25)
%>
or you can also use this in the client code
<script language="vbscript">
Sub OnLoad
Dim value
value = "abcdefghijklmnopqrstuvwxy
MsgBox Left(value,25)
End Sub
</script>
Hope it helps! :p
ASKER
Very nice Gary, once again: Cheers.
Sorry San_Gal, but I needed 25 words not 25 characters.
Sorry San_Gal, but I needed 25 words not 25 characters.
oops... sorry... didnt read that carefully! :p
At least you got your help! :)
At least you got your help! :)
oldstring="lots of different words upto 25 words"
tempstring=split(oldstring
for count=0 to 24
newstring=newstring & " " & tempstring(count)
next
response.write newstring
%>