<?xml version="1.0" encoding="iso-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Foro Vida Una : Un contador de palabras y caracteres</title>
  <link>https://www.vidauna.com/</link>
  <description><![CDATA[This is an XML content feed of; Foro Vida Una : C&#243;digos ASP y ASP.NET : Un contador de palabras y caracteres]]></description>
  <pubDate>Wed, 06 May 2026 03:39:59 +0000</pubDate>
  <lastBuildDate>Sat, 09 May 2009 16:56:32 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.07</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>https://www.vidauna.com/RSS_post_feed.asp?TID=213</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Foro Vida Una]]></title>
   <url>https://www.vidauna.com/images/vidauna_logo.gif</url>
   <link>https://www.vidauna.com/</link>
  </image>
  <item>
   <title><![CDATA[Un contador de palabras y caracteres : Este ejemplo muestra un script...]]></title>
   <link>https://www.vidauna.com/un-contador-de-palabras-y-caracteres_topic213_post672.html#672</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="https://www.vidauna.com/member_profile.asp?PF=110">Programador</a><br /><strong>Subject:</strong> 213<br /><strong>Posted:</strong> 09&nbsp;Mayo&nbsp;2009 at 4:56pm<br /><br />Este ejemplo muestra un script que cuenta las palabras y caracteres que son introducidos en un textbox:<DIV>&nbsp;</DIV><DIV>Contador.asp</DIV><DIV>&nbsp;</DIV><DIV>&lt;%<BR>Dim nombrescript<BR>Dim textodeentrada</DIV><DIV>nombrescript = Request.ServerVariables("URL")</DIV><DIV>textodeentrada = Request.Form("txtWordCount")</DIV><DIV>' Si no han escrito nada emitimos un mensaje de error<BR>If textodeentrada = "" Then<BR>textodeentrada = "Debes escribir algo en la cadena a contar"<BR>Else<BR>Response.Write "El texto introducido es::&lt;br /&gt;" &amp; vbCrLf<BR>Response.Write "&lt;pre&gt;"<BR>Response.Write Server.HTMLEncode(textodeentrada)<BR>Response.Write "&lt;/pre&gt;" &amp; vbCrLf</DIV><DIV>' Mostramos los resultados del conteo:<BR>Response.Write "&lt;p&gt;El texto introducido contiene &lt;b&gt;" _<BR>&amp; GetWordCount(textodeentrada) _<BR>&amp; "&lt;/b&gt; palabras y &lt;b&gt;" _<BR>&amp; GetCharCount(textodeentrada) _<BR>&amp; "&lt;/b&gt; caracteres.&lt;/p&gt;&lt;br /&gt;" &amp; vbCrLf<BR>End If</DIV><DIV>'**** Funciones Usadas ***********************************<BR>Function GetWordCount(strInput)<BR>Dim strTemp</DIV><DIV>' reeplazamos los tabuladores y los saltos de linea por espacios<BR>strTemp = Replace(strInput, vbTab, " ")<BR>strTemp = Replace(strTemp, vbCr, " ")<BR>strTemp = Replace(strTemp, vbLf, " ")</DIV><DIV>' Quitamos los espacios delante y detras de la cadena<BR>strTemp = Trim(strTemp)</DIV><DIV>' transformamos multiple espacios en uno solo<BR>Do While InStr(1, strTemp, " ", 1) &lt;&gt; 0<BR>strTemp = Replace(strTemp, " ", " ")<BR>Loop</DIV><DIV>' Pasamos la cadena strTemp a un array unidimensional <BR>'con la función Split <BR>GetWordCount = UBound(Split(strTemp, " ", -1, 1)) + 1<BR>End Function ' GetWordCount</DIV><DIV>Function GetCharCount(strInput)<BR>GetCharCount = Len(textodeentrada)<BR>End Function ' GetCharCount<BR>'**** Fin de funciones *************************************</DIV><DIV>%&gt;<BR>&lt;p&gt;Introduce el texto a contar:&lt;/p&gt;</DIV><DIV>&lt;form action="&lt;%= nombrescript %&gt;" method="post"&gt;<BR>&lt;textarea name="txtWordCount" cols="40" rows="5"<BR>&gt;&lt;%= Server.HTMLEncode(textodeentrada) %&gt;&lt;/textarea&gt;</DIV><DIV>&lt;br /&gt;</DIV><DIV>&lt;input type="submit"&gt;<BR>&lt;/form&gt;<BR></DIV>]]>
   </description>
   <pubDate>Sat, 09 May 2009 16:56:32 +0000</pubDate>
   <guid isPermaLink="true">https://www.vidauna.com/un-contador-de-palabras-y-caracteres_topic213_post672.html#672</guid>
  </item> 
 </channel>
</rss>