<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>substr &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/substr/</link>
	<description>Feed of posts on WordPress.com tagged "substr"</description>
	<pubDate>Fri, 25 Dec 2009 00:54:11 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[Display First name first and last name last.]]></title>
<link>http://sqlweblog.wordpress.com/2009/12/07/display-first-name-first-and-last-name-last/</link>
<pubDate>Mon, 07 Dec 2009 22:01:45 +0000</pubDate>
<dc:creator>SQLWebLogger</dc:creator>
<guid>http://sqlweblog.wordpress.com/2009/12/07/display-first-name-first-and-last-name-last/</guid>
<description><![CDATA[CREATE TABLE TEMP(ENAME VARCHAR2(100)); INSERT INTO TEMP VALUES(&#8216;SMITH,JOHN&#8217;); INSERT IN]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>CREATE TABLE TEMP(ENAME VARCHAR2(100)); </p>
<p>INSERT INTO TEMP VALUES(&#8216;SMITH,JOHN&#8217;);   <br />INSERT INTO TEMP VALUES(&#8216;SMITH,JANE&#8217;);    <br />INSERT INTO TEMP VALUES(&#8216;DOE,JOHN&#8217;);    <br />INSERT INTO TEMP VALUES(&#8216;DOVERS,JANET&#8217;); </p>
<p>SELECT ENAME,INITCAP(SUBSTR(ENAME,INSTRB(ENAME,&#8217;,')+1,LENGTH(ENAME))) &#124;&#124;&#8217; &#8216;&#124;&#124;INITCAP(SUBSTR(ENAME,1,INSTRB(ENAME,&#8217;,')-1)) ProperName   <br />FROM TEMP; </p>
<p>&#8211; Note: this wouldn&#8217;t handle spaces, but all you need to do for that is to incorporate trim function.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Substrings in Javascript with substring()]]></title>
<link>http://hollywooddigital.wordpress.com/2009/11/05/substrings-in-javascript-with-substring/</link>
<pubDate>Thu, 05 Nov 2009 08:46:19 +0000</pubDate>
<dc:creator>_mark</dc:creator>
<guid>http://hollywooddigital.wordpress.com/2009/11/05/substrings-in-javascript-with-substring/</guid>
<description><![CDATA[How to use String.substring(start, to) The old method substr() is deprecated so screw that. The pref]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h2>How to use String.substring(start, to)</h2>
<p>The old method <strong><span style="color:#800000;"><span style="color:#003366;"><span style="color:#3366ff;">substr</span>()</span></span></strong> is deprecated so screw that.  The preferred method is to now use <span style="color:#3366ff;"> </span><span style="background-color:#ffffff;"><strong><span style="color:#003366;"><span style="color:#3366ff;">substring</span>()</span></strong>.</span></p>
<p><strong><span style="color:#003366;">(<span style="color:#3366ff;">start</span>,<span style="color:#3366ff;">to</span>)</span></strong> arguments explained:</p>
<p><strong> </strong> <span style="color:#3366ff;"><strong>start</strong></span> &#8211; This is the position to <em>start</em> extracting the string from.   Zero based, so the first character is 0, then 1 and so on.</p>
<p><strong><span style="color:#3366ff;">to</span></strong> &#8211; This is the position to copy <em>to</em> and should obviously be greater than <em>start</em>.  <strong> It does not include the character at </strong><span style="color:#3366ff;"><strong>to</strong></span>.   So, if <em>to</em> is the same as <em>start</em> then nothing will be returned.  If <em>to</em> is not present then the rest of the string from <em>start</em> is returned.</p>
<p>The examples below use the following string.</p>
<pre style="background-color:#fff;color:#3366ff;font-size:18px;">var s = "abcdefghij"</pre>
<p>The first example returns the characters from positions 5 to 6. Remember that the string is zero indexed so the character at position 5 in the above string is &#8220;f&#8221;</p>
<pre style="background-color:#fff;color:#3366ff;font-size:18px;">s.substring(5, 7); <span style="color:#003366;">// returns "fg"</span></pre>
<p>The second example returns the characters from 5 to the end of the string:</p>
<pre style="background-color:#fff;color:#3366ff;font-size:18px;">s.substring(5); <span style="color:#003366;">// returns "fghij"</span></pre>
<p>The next example returns the characters from positions 0 to 4 (i.e. 5 characters in total):</p>
<pre style="background-color:#fff;color:#3366ff;font-size:18px;">s.substring(0, 5); <span style="color:#003366;">// returns "abcde"</span></pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Cadenas en php (string) - Funciones para manipularlas]]></title>
<link>http://programarenajax.wordpress.com/2009/08/08/cadenas-en-php-string-funciones-para-manipularlas/</link>
<pubDate>Sat, 08 Aug 2009 18:11:56 +0000</pubDate>
<dc:creator>admin</dc:creator>
<guid>http://programarenajax.wordpress.com/2009/08/08/cadenas-en-php-string-funciones-para-manipularlas/</guid>
<description><![CDATA[SUBSTR $cadena=&#8221;Hola, bienvenidos a mi blog. Gracias por ingresar a: &#8212;programar&#8212;en]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;color:#333;padding:6px;">
<div style="color:#D25A20;">
<h3>SUBSTR</h3>
</div>
<p>$cadena=&#8221;<span style="color:#C00;">Hola, bienvenidos a mi blog. Gracias por ingresar a: &#8212;programar&#8212;en&#8212;ajax&#8212;</span>&#8220;;</p>
<p><span style="font-size:16px;">Función &#8216;<span style="color:#00F;">substr</span>&#8216;:&#60;!&#8211; Sustrae parte de una cadena. <span style="color:#00F;">substr</span>($cadena,<span style="font-weight:bold;color:#333;font-size:12px;">PosicionInicial</span>,<span style="font-weight:bold;color:#333;font-size:12px;">PosicionFinal</span>);</span></p>
<p>1) $substr=<span style="color:#00F;">substr</span>($cadena,<span style="color:#C00;">0</span>,<span style="color:#C00;">40</span>);</p>
<p>2) $substr=<span style="color:#00F;">substr</span>($cadena,<span style="color:#C00;">9</span>,<span style="color:#C00;">6</span>);</p>
<p><span style="color:#960;">Resultado1:</span> &#8220;Hola, bienvenidos a mi blog. Gracias por&#8221;</p>
<p><span style="color:#960;">Resultado2:</span> &#8220;nvenid&#8221; // <span class="verde">La cadena 9, 6 se dirige a la posición 9 y a partir de ese lugar cuenta seis caracteres hacia adelante.</span></div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;">
<div style="color:#D25A20;">
<h3>SPLIT</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">split</span>&#8216;: Parte una cadena a partir de una expresión y la convierte en un Array. <span style="color:#00F;">split</span>(<span style="font-weight:bold;color:#333;font-size:12px;">separador</span>,$cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;Hola, bienvenidos a mi blog. Gracias por ingresar a: &#8212;programar&#8212;en&#8212;ajax&#8212;&#8221;</span>;</p>
<p>$split=<span style="color:#00F;">split</span>(<span style="color:#C00;">&#8220;&#8212;&#8221;</span>,$cadena);</p>
<p>for($i=0; $i&#60;<span style="color:#00F;">count</span>($split);$i<span style="color:#00F;">++</span>){</p>
<p><span style="color:#00F;">echo</span> <span style="color:#C00;">&#8220;&#60;p&#62;&#8221;</span>.$split<span style="color:#00F;">[</span>$i<span style="color:#00F;">]</span>.<span style="color:#C00;">&#8220;&#60;/p&#62;&#8221;</span>; <span class="verde">//imprimo cada valor del array</span></p>
<p>}</p>
<p><span style="color:#960;">Resultado:</span>Hola, bienvenidos a mi blog. Gracias por ingresar a:</p>
<p>programar</p>
<p>en</p>
<p>ajax</p></div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;">
<div style="color:#D25A20;">
<h3>TRIM</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">trim</span>&#8216;: Elimina los espacios en blanco al principio y al final. <span style="color:#00F;">trim</span>(<span style="font-weight:bold;color:#333;font-size:12px;">cadena</span>)</p>
<p>$cadena=<span style="color:#C00;">&#8221;             Hola         &#8220;</span>;</p>
<p><span style="color:#00F;">echo trim</span>($cadena);</p>
<p><span style="color:#960;">Resultado:</span>&#8220;Hola&#8221;</div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;">
<div style="color:#D25A20;">
<h3>STRLEN</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">strlen</span>&#8216;: Devuelve la longitud de una cadena. <span style="color:#00F;">strlen</span>(<span style="font-weight:bold;color:#333;font-size:12px;">cadena</span>)</p>
<p>$cadena=<span style="color:#C00;">&#8220;Hola&#8221;</span>;</p>
<p><span style="color:#00F;">echo strlen</span>($cadena);</p>
<p><span style="color:#960;">Resultado:</span>4</div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;">
<div style="color:#D25A20;">
<h3>STR_REPLACE</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">str_replace</span>&#8216;: busca una cadena dentro de otra y la reemplaza.. <span style="color:#00F;">str_replace</span>(<span style="font-weight:bold;color:#333;font-size:12px;">Parteareemplazar</span>,<span style="font-weight:bold;color:#333;font-size:12px;">Cambiarlaporesto</span>,$cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;Hola&#8221;</span>;</p>
<p><span style="color:#00F;">echo str_replace</span>(&#8220;H&#8221;,&#8221;hacheMuda&#8221;,$cadena);</p>
<p><span style="color:#960;">Resultado:</span>&#8220;hacheMudaola&#8221;</div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;">
<div style="color:#D25A20;">
<h3>Explode</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">explode</span>&#8216;: explota la cadena y la convierte en un array. <span style="color:#00F;">explode</span>(<span style="font-weight:bold;color:#333;font-size:12px;">Cadenaseparadora,cadenaoriginal</span>)</p>
<p>$cadena=<span style="color:#C00;">&#8220;H-o-l-a&#8221;</span>;</p>
<p>$nueva=<span style="color:#00F;"> explode</span>(<span style="color:#C00;">&#8220;-&#8221;</span>,$cadena);</p>
<p><span style="color:#00F;">echo</span> $nueva[0];</p>
<p><span style="color:#00F;">echo</span> $nueva[1];</p>
<p><span style="color:#00F;">echo</span> $nueva[2];</p>
<p><span style="color:#00F;">echo </span>$nueva[3];</p>
<p><span style="color:#960;">Resultado1:</span>H <span style="color:#960;">Resultado2:</span>o <span style="color:#960;">Resultado3:</span>l <span style="color:#960;">Resultado4:</span>a</div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;color:#333;padding:6px;">
<div style="color:#D25A20;">
<h3>MD5 (encriptar)</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">md5</span>&#8216;:Calcula el hash md5 usando RSA Data Security, Inc.     MD5 Message-Digest Algorithm. <span style="color:#00F;">md5</span>($cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;Hola#$%%&#38;/(()))ññññllá´´aá&#60;p&#62;&#60;áaaa&#62;&#60;&#8221;</span>;</p>
<p><span style="color:#00F;">echo</span> <span style="color:#00F;">md5</span>($cadena);</p>
<p><span style="color:#960;">Resultado:</span> &#8220;18b128ebafa508f565e7e50f9d225c63&#8243;</div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;color:#333;padding:6px;">
<div style="color:#D25A20;">
<h3>STR_SHUFFLE</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">str_shuffle</span>&#8216;:Reordena de forma aleatoria la cadena dada. <span style="color:#00F;">str_shuffle</span>($cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;Hola#$%%&#38;/(()))ññññllá´´aá&#60;p&#62;&#60;áaaa&#62;&#60;&#8221;</span>;</p>
<p><span style="color:#00F;">echo</span> <span style="color:#00F;">str_shuffle</span>($cadena);</p>
<p><span style="color:#960;">Resultado:</span> &#8220;laáa#ñ&#38;/p$)ñ&#60;´&#60;)o%añá´(añ&#62;&#8221;</div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;color:#333;padding:6px;">
<div style="color:#D25A20;">
<h3>STR_WORD_COUNT</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">str_word_count</span>&#8216;:Cuenta la cantidad de palabras de una cadena.<span style="color:#00F;">str_word_count</span>($cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;Hola, programarenajax.wordpress.com&#8221;</span>;</p>
<p><span style="color:#00F;">echo</span> <span style="color:#00F;">str_word_count</span>($cadena);</p>
<p><span style="color:#960;">Resultado:</span>4 <span style="color:#666;">//Devuelve cuatro porque hay cuatro palabras. Cuenta cada palabra separándolas por símbolos. 1: Hola. 2: programarenajax 3:wordpress 4:com</span></div>
<div style="margin-top:6px;border:2px #069 solid;background:#F5F5EB;font-family:Verdana, Geneva, sans-serif;font-size:10px;color:#333;padding:6px;">
<div style="color:#D25A20;">
<h3>STRTOLOWER, STRTOUPPER,HTMLENTITIES Y HTML_ENTITY_DECODE</h3>
</div>
<p>Función &#8216;<span style="color:#00F;">strtolower</span>&#8216;:Convierte una cadena a minúsculas. <span style="color:#00F;">strtolower</span>($cadena);</p>
<p>Función &#8216;<span style="color:#00F;">strtoupper</span>&#8216;:Convierte una cadena a mayúsculas. <span style="color:#00F;">strtoupper</span>($cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;HOLA, PROGRAMARENAJAX.wordpress.com&#8221;</span>;</p>
<p><span style="color:#00F;">echo </span><span style="color:#00F;">strtolower</span>($cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;HOLA, PROGRAMARENAJAX.wordpress.com&#8221;</span>;</p>
<p><span style="color:#00F;">echo </span><span style="color:#00F;">strtoupper</span>($cadena);</p>
<p><span style="color:#960;">Resultado1:</span>&#8220;hola, programarenajax.wordpress.com&#8221;.</p>
<p><span style="color:#960;">Resultado2:</span>&#8220;HOLA, PROGRAMARENAJAX.WORDPRESS.COM&#8221;</p>
<p>Función &#8216;<span style="color:#00F;">htmlentities</span>&#8216;:Convierte todos los caracteres aplicables a caracteres html. <span style="color:#00F;">htmlentities</span>($cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;&#60;p&#62;&#60;div&#62;&#60;script&#62;holaprogramarenajax.wordpress.com&#60;/script&#62;&#8221;</span>;</p>
<p>$texto=<span style="color:#00F;">htmlentities</span>($cadena);</p>
<p><span style="color:#00F;">echo</span> <span style="color:#C00;">&#8220;$texto&#8221;</span>;</p>
<p><span style="color:#960;">Resultado:</span>&#8220;&#60;p&#62;&#60;div&#62;&#60;script&#62;holaprogramarenajax.wordpress.com&#60;/script&#62;&#8221;<span style="color:#666;"> //Al hacer esto, no aparece el div escrito, tampoco los saltos de línea y el script tampoco se ejecuta, sólamente se transcribe de manera literal para poder mostrar código.</span></p>
<p>Función &#8216;<span style="color:#00F;">html_entity_decode</span>&#8216;:Convierte todos los caracteres aplicables a caracteres html.<span style="color:#00F;">html_entity_decode</span>($cadena);</p>
<p>$cadena=<span style="color:#C00;">&#8220;&#38;lt;p&#38;gt;&#38;lt;div&#38;gt;&#38;lt;script&#38;gt;holaprogramarenajax.wordpress.com&#38;lt;/script&#38;gt;&#8221;</span>;</p>
<p>$texto=<span style="color:#00F;">html_entity_decode</span>($cadena);</p>
<p><span style="color:#00F;">echo</span><span style="color:#C00;">&#8220;$texto&#8221;</span>;</p>
<p><span style="color:#960;">Resultado:</span>&#8220;&#8221;<span style="color:#666;"> //Es vacío porque se ejecutan los saltos de línea y el script, por ende, no son visibles.</span></div>
<p>Link con una visualización un poco mejor que la de wordpress&#8230; :<a href="http://php-online.com.ar/muestras/car.php">Link</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Oracle's the  most common character functions usages]]></title>
<link>http://anutwalidera.wordpress.com/2009/05/08/oracle-the-most-common-chracter-function-usage/</link>
<pubDate>Fri, 08 May 2009 13:20:33 +0000</pubDate>
<dc:creator>anutwalidera</dc:creator>
<guid>http://anutwalidera.wordpress.com/2009/05/08/oracle-the-most-common-chracter-function-usage/</guid>
<description><![CDATA[In this post, I would like to demonstrate how each character function behaves with its string input;]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In this post, I would like to demonstrate how each character function behaves with its string input;</p>
<p><strong>REPLACE </strong></p>
<pre class="brush: sql;">
replace(inThisString,'oldValue','newValue')
</pre>
<pre class="brush: sql;">
CUSTOMER_ID            NAME                 SURNAME
---------------------- -------------------- --------------------
1                      oldvalue             walidera
2                      NULL                 long                 

2 rows selected
SELECT customer_id,REPLACE(name,'oldvalue','newvalue') as name, surname FROM customers;

CUSTOMER_ID            NAME                  SURNAME
---------------------- -------------------   -------------------
1                      newvalue              walidera
2                      NULL                  long                 

2 rows selected
</pre>
<p><strong>INSTR<br />
</strong></p>
<pre class="brush: sql;">
instr( findInThisString, searchThisString [, start-position] [,  nth-occurence ]  )
</pre>
<pre class="brush: sql;">
SELECT INSTR('Hello SQL World','o', 1 , 1) FROM DUAL;
--&gt;&gt; Result is 5 [The first occurence of 'o' character]
SELECT INSTR('Hello SQL World','o', 1 , 2) FROM DUAL;
--&gt;&gt; Result is 12 [The second occurence of 'o' character]
SELECT INSTR('Hello SQL World','a', 1 , 1) FROM DUAL;
--&gt;&gt; Result is 0 [so there is no a in this string]
</pre>
<p><strong>NVL </strong></p>
<pre class="brush: sql;">
NVL('searchInThisString', value)
 --returns value if 'searchInThisString' is Null otherwise 'searchInThisString' returns
</pre>
<pre class="brush: sql;">

select * from customers;

CUSTOMER_ID            NAME                 SURNAME
---------------------- -------------------- --------------------
1                      oldvalue             walidera
2                      NULL                 long                 

2 rows selected

SELECT customer_id,NVL(name,'Replaced Value') as name, surname FROM customers;

CUSTOMER_ID            NAME                 SURNAME
---------------------- -------------------- --------------------
1                      oldvalue             walidera
2                      Replaced Value       long                 

2 rows selected
</pre>
<p><strong>NVL2 </strong></p>
<pre class="brush: sql;">
NVL2('searchInThisString', value1, value2)
--returns value2 if searchInThisString is NULL otherwise value1 returns
</pre>
<pre class="brush: sql;">

SELECT * FROM customers;

CUSTOMER_ID            NAME                 SURNAME
---------------------- -------------------- --------------------
1                      oldvalue             walidera
2                      NULL                 long                 

2 rows selected

SELECT customer_id,NVL2(name,'VALUE1','VALUE2') as name, surname FROM customers;

CUSTOMER_ID            NAME   SURNAME
---------------------- ------ --------------------
1                      VALUE1 walidera
2                      VALUE2 long                 

2 rows selected
</pre>
<p><strong>SUBSTR </strong></p>
<pre class="brush: sql;">
SUBSTR('inThisString', startPoint [,length])
--length is optional however starpoint is required
--returns a part of whole string
</pre>
<pre class="brush: sql;">

SELECT * FROM customers;

CUSTOMER_ID            NAME                 SURNAME
---------------------- -------------------- --------------------
1                      oldvalue             walidera
2                      NULL                 long                 

2 rows selected

SELECT customer_id,SUBSTR(name,1,2) as name, surname FROM customers;
--start from first character and take 2 character

CUSTOMER_ID            NAME SURNAME
---------------------- ---- --------------------
1                      ol   walidera
2                      NULL long                 

2 rows selected

SELECT customer_id,SUBSTR(name,2,2) as name, surname FROM customers;
--start from second character and take 2 character

CUSTOMER_ID            NAME SURNAME
---------------------- ---- --------------------
1                      ld   walidera
2                      NULL long                 

2 rows selected
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[String Functions:INSTR,SUBSTR, REPLACE,TRANSLATE]]></title>
<link>http://mohibalvi.wordpress.com/2009/03/29/instr-substr-replace-translate/</link>
<pubDate>Sun, 29 Mar 2009 22:08:05 +0000</pubDate>
<dc:creator>mohibalvi</dc:creator>
<guid>http://mohibalvi.wordpress.com/2009/03/29/instr-substr-replace-translate/</guid>
<description><![CDATA[What built-in functions/operators are available for manipulating strings? The most useful ones are L]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><h6>What built-in functions/operators are available for manipulating strings?</h6>
<p>The most useful ones are <tt>LENGTH</tt>, <tt>SUBSTR</tt>, <tt>INSTR</tt>, and <tt>&#124;&#124;</tt>:</p>
<ul>
<li><tt>LENGTH(str)</tt> returns the length of <tt>str</tt> in characters. </li>
<li><tt>SUBSTR(str,m,n)</tt> returns a portion of <tt>str</tt>, beginning at character <tt>m</tt>, <tt>n</tt> characters long. If <tt>n</tt> is omitted, all characters to the end of <tt>str</tt> will be returned. </li>
<li><tt>INSTR(str1,str2,n,m)</tt> searches <tt>str1</tt> beginning with its <tt>n</tt>-th character for the <tt>m</tt>-th occurrence of <tt>str2</tt> and returns the position of the character in <tt>str1</tt> that is the first character of this occurrence. </li>
<li><tt>str1 &#124;&#124; str2</tt> returns the concatenation of <tt>str1</tt> and <tt>str2</tt>. </li>
</ul>
<p>The example below shows how to convert a string <tt>name</tt> of the format <tt>'last, first'</tt> into the format <tt>'first last'</tt>:</p>
<p><strong>SUBSTR(name,INSTR(name,&#8217;,',1,1)+2) &#124;&#124;&#8217; &#8216;&#124;&#124; SUBSTR(name, 1, INSTR(name,&#8217;,',1,1)-1)</strong></p>
<p>For case-insensitive comparisons, first convert both strings to all upper case using Oracle&#8217;s built-in function <tt>upper()</tt> (or all lower case using <tt>lower()</tt>).</p>
<p><strong></strong></p>
<p><strong>SUBSTR</strong></p>
<p>The syntax for the <strong>substr</strong> function is:</p>
<blockquote><p>substr( string, start_position, [ length ] )</p>
</blockquote>
<p><em>string</em> is the source string.    <br /><em>start_position</em> is the position for extraction. The first position in the string is always 1.    <br /><em>length</em> is optional. It is the number of characters to extract. If this parameter is omitted, <strong>substr</strong> will return the entire string.</p>
<p>substr(&#8216;This is a test&#8217;, 6, 2) would return &#8216;is&#8217;</p>
<p>substr(&#8216;This is a test&#8217;, 6) would return &#8216;is a test&#8217;</p>
<p>substr(&#8216;TechOnTheNet&#8217;, 1, 4) would return &#8216;Tech&#8217;</p>
<p>substr(&#8216;TechOnTheNet&#8217;, -3, 3) would return &#8216;Net&#8217;</p>
<p><strong>INSTR</strong></p>
<p>The syntax for the <strong>instr</strong> Oracle function is:</p>
<blockquote><p>instr( string1, string2 [, start_position [, nth_appearance ] ] )</p>
</blockquote>
<p><em>string1</em> is the string to search.</p>
<p><em>string2</em> is the substring to search for in <em>string1</em>.</p>
<p><em>start_position</em> is the position in <em>string1</em> where the search will start. This argument is optional. If omitted, it defaults to 1. The first position in the string is 1. If the <em>start_position</em> is negative, the function counts back <em>start_position</em> number of characters from the end of <em>string1</em> and then searches towards the beginning of <em>string1</em>.</p>
<p><strong></strong></p>
<p><strong>SUBSTR and INSTR </strong></p>
<p>Query returns string after the 6th occurence of &#8216;\&#8217; in full path of data file name</p>
<p>select <strong>substr(name,instr(name,&#8217;\',1,6)+1)</strong> from v$datafile</p>
<p>SYSTEM01.DBF   <br />USERS01.DBF    <br />SYSAUX.DBF</p>
<p><strong></strong></p>
<p><strong>REPLACE</strong></p>
<p>The syntax for the <strong>replace</strong> function is:</p>
<p>replace( string1, string_to_replace, [ replacement_string ] )</p>
<p><em>string1</em> is the string to replace a sequence of characters with another set of characters.</p>
<p><em>string_to_replace</em> is the string that will be searched for in <em>string1</em>.</p>
<p><em>replacement_string</em> is optional. All occurrences of <em>string_to_replace</em> will be replaced with <em>replacement_string</em> in <em>string1</em>. If the <em>replacement_string</em> parameter is omitted, the <strong>replace</strong> function simply removes all occurrences of <em>string_to_replace</em>, and returns the resulting string.</p>
<p>replace(&#8216;123tech123&#8242;, &#8216;123&#8242;); would return &#8216;tech&#8217;</p>
<p>replace(&#8216;222tech&#8217;, &#8216;2&#8242;, &#8216;3&#8242;);&#160;&#160;&#160; would return &#8216;333tech&#8217;</p>
<p>&#160;</p>
<p><strong>TRANSLATE</strong></p>
<p>TRANSLATE(&#60;string&#62;, &#60;&#8217;list_to_match&#8217;&#62;,&#60;&#8217;replacements_list&#8217;&#62;)</p>
<p>This demo replaces all commas with vertical bars.</p>
<blockquote><p>SELECT TRANSLATE(&#8216;comma,delimited,list&#8217;, &#8216;<strong>,</strong>&#8216;, &#8216;<strong>&#124;</strong>&#8216;)      <br />FROM dual;      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-      <br />comma&#124;delimited&#124;list</p>
</blockquote>
<p>The following takes a DNA sequence and returns its complement.</p>
<blockquote><p>SELECT TRANSLATE(&#8216;CAG-TTT-GAC-ACA-TGG-ATC&#8217;, &#8216;ACGT&#8217;, &#8216;GATC&#8217;) DNA     <br />FROM dual;      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-      <br />AGT-CCC-TGA-GAG-CTT-GCA</p>
</blockquote>
<p>In this demo the number of vowels in the string is counted</p>
<blockquote><p>WITH data AS (SELECT &#8216;Whose line is it anyway&#8217; line FROM dual)     <br />SELECT LENGTH(line)-LENGTH(TRANSLATE(line,&#8217;xaeiou&#8217;,'x&#8217;)) nbVowels      <br />FROM data;      <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-      <br />8</p>
</blockquote>
<p><font color="#736926"></font></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Flex Tutorials and samples]]></title>
<link>http://newflexworld.wordpress.com/2009/02/01/flex-tutorials-and-samples/</link>
<pubDate>Sun, 01 Feb 2009 10:18:06 +0000</pubDate>
<dc:creator>ursprakash</dc:creator>
<guid>http://newflexworld.wordpress.com/2009/02/01/flex-tutorials-and-samples/</guid>
<description><![CDATA[Flex is a highly productive, free open source framework for building and maintaining expressive web ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Flex is a highly productive, free open source framework for building and maintaining expressive web applications that deploy consistently on all major browsers, desktops, and operating systems -Adobe</p>
<p> </p>
<p><strong><a href="http://gnanz-flexworld.blogspot.com">Adobe Flex</a></strong> is a collection of technologies released by Adobe Systems for the development and deployment of cross platform rich Internet applications based on the proprietary Adobe Flashplatform. The initial release in March 2004 by Macromedia included a software development kit, anIDE, and a J2EE integration application known as Flex Data Services. Since Adobe acquired Macromedia in 2005, subsequent releases of Flex no longer require a license for Flex Data Services, which has become a separate product rebranded as LiveCycle Data Services. -Wikipedia</p>
<p> </p>
<p> </p>
<p>There are many sites providing the tutorials and samples in net.Here is my <a title="Flex Sanples blog" href="http://gnanz-flexworld.blogspot.com" target="_blank">Flex samples blog </a>,</p>
<p> </p>
<p><a title="http://gnanz-flexworld.blogspot.com" href="http://gnanz-flexworld.blogspot.com" target="_blank">http://gnanz-flexworld.blogspot.com</a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[StrPos no Firebird - PSQL]]></title>
<link>http://pobrecomputeiro.wordpress.com/2008/10/21/strpost-no-firebird-psql/</link>
<pubDate>Tue, 21 Oct 2008 17:01:03 +0000</pubDate>
<dc:creator>lmmoreira</dc:creator>
<guid>http://pobrecomputeiro.wordpress.com/2008/10/21/strpost-no-firebird-psql/</guid>
<description><![CDATA[Continuando com a série de funções PSQL para Firebird postarei mas uma função rápida, que vale mais ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Continuando com a série de funções PSQL para Firebird postarei mas uma função rápida, que vale mais como uma pequena dica, visto que ainda estou meio sem tempo para fazer um post legal englobando Stored Procedures, Triggers, Views e etc.</p>
<p>Vamos ao trabalho!</p>
<p>Como dito acima, postarei apenas uma função (Stored Procedure) por hoje.</p>
<p>Falaremos sobre o STR_POS, que todos conhecemos, que retorna a primeira ou a ultima, dependendo do parâmetro incluído, posição de uma string em outra string.</p>
<p>Complicado ?</p>
<p>Veja um exemplo!</p>
<p>Na String &#8220;Leonardo Machado Moreira&#8221;, caso apliquemos a função <strong>strpos</strong> procurando por Machado, obteriamos o inteiro 10 como resultado.</p>
<p>Este tipo de função é muito útil quando estamos trabalhando com strings. Caso ache que estou mentindo espere e verá.</p>
<p>Criação</p>
<p>Assim como no post anterior, podemos criar uma Stored Procedure com o seguinte comando rodado em uma query com acesso ao nosso banco de dados</p>
<p style="padding-left:30px;"><strong>CREATE PROCEDURE STR_POS (</strong></p>
<p style="padding-left:60px;"><strong>PROCURAR Varchar(8192),<br />
ONDE Varchar(8192),<br />
OCORRENCIA Char(1) </strong></p>
<p style="padding-left:30px;"><strong>)<br />
RETURNS (</strong></p>
<p style="padding-left:60px;"><strong>RESULT Integer </strong></p>
<p style="padding-left:30px;"><strong>)<br />
AS</strong></p>
<p style="padding-left:60px;"><strong>Declare Variable i Integer;<br />
Declare Variable sTmp Varchar(8192);</strong></p>
<p style="padding-left:30px;"><strong>BEGIN</strong></p>
<p style="padding-left:60px;"><strong>i = 1;<br />
while(i &#60;= char_length(:ONDE))do<br />
begin</strong></p>
<p style="padding-left:90px;"><strong>sTmp = substring(:ONDE from i for char_length(:PROCURAR));</strong></p>
<p style="padding-left:90px;"><strong>if(:sTmp = <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ROCURAR)then<br />
begin</strong></p>
<p style="padding-left:120px;"><strong>RESULT = i;</strong></p>
<p style="padding-left:120px;"><strong>if(:OCORRENCIA = &#8216;P&#8217;)then<br />
begin</strong></p>
<p style="padding-left:150px;"><strong>SUSPEND;<br />
Exit;</strong></p>
<p style="padding-left:120px;"><strong>end</strong></p>
<p style="padding-left:90px;"><strong>end</strong></p>
<p style="padding-left:90px;"><strong>i = i + 1;</strong></p>
<p style="padding-left:60px;"><strong>end</strong></p>
<p style="padding-left:60px;"><strong>SUSPEND;</strong></p>
<p style="padding-left:30px;"><strong>END<br />
</strong></p>
<p>Uma coisa que eu não citei no post anterior é a maneira que alteramos uma Stored Procedure. Imagine que já tenhamos criado STR_POS, porém queremos altera-lá, basta rodar o mesmo código com a sintaxe de alteração, obviamente alterando o que você deseja.</p>
<p style="padding-left:30px;"><strong>ALTER</strong><strong> PROCEDURE STR_POS (</strong></p>
<p style="padding-left:60px;"><strong>PROCURAR Varchar(8192),<br />
ONDE Varchar(8192),<br />
OCORRENCIA Char(1) </strong></p>
<p style="padding-left:30px;"><strong>)<br />
RETURNS (</strong></p>
<p style="padding-left:60px;"><strong>RESULT Integer </strong></p>
<p style="padding-left:30px;"><strong>)<br />
AS</strong></p>
<p style="padding-left:60px;"><strong>Declare Variable i Integer;<br />
Declare Variable sTmp Varchar(8192);</strong></p>
<p style="padding-left:30px;"><strong>BEGIN</strong></p>
<p style="padding-left:60px;"><strong>i = 1;<br />
while(i &#60;= char_length(:ONDE))do<br />
begin</strong></p>
<p style="padding-left:90px;"><strong>sTmp = substring(:ONDE from i for char_length(:PROCURAR));</strong></p>
<p style="padding-left:90px;"><strong>if(:sTmp = <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ROCURAR)then<br />
begin</strong></p>
<p style="padding-left:120px;"><strong>RESULT = i;</strong></p>
<p style="padding-left:120px;"><strong>if(:OCORRENCIA = &#8216;P&#8217;)then<br />
begin</strong></p>
<p style="padding-left:150px;"><strong>SUSPEND;<br />
Exit;</strong></p>
<p style="padding-left:120px;"><strong>end</strong></p>
<p style="padding-left:90px;"><strong>end</strong></p>
<p style="padding-left:90px;"><strong>i = i + 1;</strong></p>
<p style="padding-left:60px;"><strong>end</strong></p>
<p style="padding-left:60px;"><strong>SUSPEND;</strong></p>
<p style="padding-left:30px;"><strong>END<br />
</strong></p>
<p>Assim como a função do post anterior esta função também é bem intuitiva, veja:</p>
<p>No inicio criamos ou alteramos a Stored Procedure STR_POS com os três parâmetros indicados acima. Note que os dois primeiros parâmetros cujos valores serão strings que não conhecemos coloquei o tamanho como <strong>varchar(8192)</strong>, isto porque <strong>varchar</strong> é um tipo de dado que se adapta de acordo com o valor incluído então caso não passemos nada para um varchar de 8192 o seu tamanho será zero. Diferentemente do <strong>char</strong> que não tem o seu tamanho variável, então caso uma string não tenha o tamanho do campo char o Firebird a completa com espaços em branco à direita.</p>
<p>Então criamos as duas variáveis, sem muito mistério.</p>
<p>E fazemos um loop <strong>while</strong> enquando i for menor ou igual ao tamanho da string :ONDE. A função <strong>char_length </strong>retorna a quantidade de caracteres que uma string possuí.</p>
<p>Importante lembrar que esta função char_length é nativa do Firebird 2.1, e cada versão do Firebird apresenta ela com um nome.</p>
<p>Dentro do loop temos outro exemplo de função nativa do Firebird que é a substring, esta também muito conhecida dos desenvolvedores, ela pega a string :ONDE e retira o texto entre a posição i e a posição <strong>char_length(:PROCURAR) </strong>que neste caso referência o final da string.</p>
<p>Então a partir daí temos o uso do if no Firebird que é muito simples, o Suspend que já vimos no post anterior e o comando Exit que como você pode ter imaginado deixa a função imediatamente.</p>
<p>A maneira que rodamos esta função como ja disse no post anterior é muito simples:</p>
<p style="padding-left:30px;">Execute procedure STR_POS(&#8216;Machado&#8217;, &#8216;Leonardo Machado Moreira&#8217;, &#8216;P&#8217;)</p>
<p style="padding-left:30px;">Retorno: 10</p>
<p style="padding-left:30px;">Select result from STR_POS(&#8216;Machado&#8217;, &#8216;Leonardo Machado Moreira&#8217;, &#8216;P&#8217;)</p>
<p style="padding-left:30px;">Retorno: 10</p>
<p>Podemos também procurar de trás para frente a ocorrencia da string ou a ultima ocorrência da string.</p>
<p style="padding-left:30px;">Select result FROM STR_POS(&#8216;M&#8217;, &#8216;Leonardo Machado Moreira&#8217;, &#8216;U&#8217;)</p>
<p style="padding-left:30px;">Retorno:18</p>
<p>Bom por hoje é só peço para aqueles que acharam o post muito breve e superficial que deem uma lida no post <a href="http://pobrecomputeiro.wordpress.com/2008/10/20/psql-no-firebird-stored-procedure-strzero-com-parametro-default/">anterior</a> que tem muita informação que não coloquei aqui pois já está lá e eu não quero repetir.</p>
<p>Obrigado, caso tenha alguma dúvida ou tenha notado algum erro meu deixe postado nos coments que tentarei ajuda-lo o mais breve possível.<strong> </strong></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Memotong tulisan pada PHP]]></title>
<link>http://ianbali.wordpress.com/2008/10/10/memotong-tulisan-pada-php/</link>
<pubDate>Fri, 10 Oct 2008 00:27:13 +0000</pubDate>
<dc:creator>ianbali</dc:creator>
<guid>http://ianbali.wordpress.com/2008/10/10/memotong-tulisan-pada-php/</guid>
<description><![CDATA[Mungkin banyak sekali pertanyaan bagaimana cara memotong tulisan yang panjangnya se-abrek pada PHP, ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Mungkin banyak sekali pertanyaan bagaimana cara memotong tulisan yang panjangnya se-abrek pada PHP, kalo menggunakan printah <a rel="no follow" href="http://php.net/function.substr" target="_blank">substr()</a> secara langsung kayaknya kurang wokeh deh karena tiap paragraph beda panjang tulisan otomatis terkadang tulisan jadi tidak bagus terbaca contoh &#8220;ini ibu budi&#8221;, jika kita mengambil 6 karakter dari karakter pertama maka jadinya &#8220;ini ib&#8221; aneh kan.., nah sekarang bagaimana melakukan pemotongan tulisan dengan teknik yang lembut.<!--more--></p>
<blockquote><p>&#60;?<br />
   /*  copyright global-algorithm@server-labs.pondokiklan.com<br />
    *  Release Oct, 14 08 <br />
    */</p>
<p>     function SOFTCUTER($tulisan, $count) {<br />
        $count <span> </span>= $count;</p>
<p>           $length = strlen($tulisan);<br />
              if($length&#62;$count) {<br />
                 $i = $count;<br />
                 while($i != 0) {<br />
                    if(substr($tulisan,$i,1) == &#8221; &#8220;) { <br />
    <span>                   </span>break;<br />
    <span>                </span>} else { <br />
                    }<br />
                 $i = $i-1;<br />
                }<span> </span>     <br />
             $tulisan = substr($tulisan,0,$i);<br />
             $tulisan = $tulisan;<br />
        } else {<br />
           $tulisan <span> </span>= $tulisan;<br />
        }<br />
       $tulisan <span> </span>= strtolower($tulisan); <br />
       return $tulisan;<br />
     }</p>
<p> $text<span> </span>= &#8220;Ini Ibu Budi Sedang Belajar PHP&#8221;;<br />
 print SOFTCUTER($text, 6); // 6 &#60;= adalah jumlah karakter yg mau di pakai</p>
<p>?&#62;</p></blockquote>
<p> </p>
<p>hasilnya, coba sendiri yach</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Re URGENT What if 117d after sponsorship applicationb ]]></title>
<link>http://phpkituz.wordpress.com/2008/08/11/re-urgent-what-if-117d-after-sponsorship-applicationb/</link>
<pubDate>Mon, 11 Aug 2008 06:21:41 +0000</pubDate>
<dc:creator>phpkituz</dc:creator>
<guid>http://phpkituz.wordpress.com/2008/08/11/re-urgent-what-if-117d-after-sponsorship-applicationb/</guid>
<description><![CDATA[Hi. Quote from Ronii on August 07 2008 11 10 11 pm. All Anyone knows how to resolve the issue of 117]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Hi. Quote from Ronii on August 07 2008 11 10 11 pm. All Anyone knows how to resolve the issue of 117 9 d Got married just before landed but didn t know that<br />
canadavisa.com</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[String Functions in Oracle/PLSQL]]></title>
<link>http://purna.wordpress.com/2008/04/08/string-functions-in-oracleplsql/</link>
<pubDate>Tue, 08 Apr 2008 07:53:27 +0000</pubDate>
<dc:creator>purna</dc:creator>
<guid>http://purna.wordpress.com/2008/04/08/string-functions-in-oracleplsql/</guid>
<description><![CDATA[Tulisan ini berisi penjelasan disertai contoh mengenai fungsi-fungsi dalam Oracle/PLSQL yang berkait]]></description>
<content:encoded><![CDATA[Tulisan ini berisi penjelasan disertai contoh mengenai fungsi-fungsi dalam Oracle/PLSQL yang berkait]]></content:encoded>
</item>
<item>
<title><![CDATA[Les 2 visages de la fonction SUBSTR]]></title>
<link>http://thesasreference.wordpress.com/2008/02/26/substr/</link>
<pubDate>Tue, 26 Feb 2008 20:01:02 +0000</pubDate>
<dc:creator>The SAS Reference</dc:creator>
<guid>http://thesasreference.wordpress.com/2008/02/26/substr/</guid>
<description><![CDATA[  Définir une nouvelle variable à partir de x caractères d&#8217;une autre variable. Substituer, dan]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img src="http://thesasreference.wordpress.com/files/2008/02/2_visages.jpg" alt="2_visages.jpg" /> </p>
<p>Définir une nouvelle variable à partir de x caractères d&#8217;une autre variable. Substituer, dans une variable texte, les x caractères à partir du z<sup>ème</sup>. Ces deux thématiques fortes différentes sont traitées avec la même fonction SUBSTR. Selon qu&#8217;elle soit placée à gauche ou à droite de l&#8217;égalité, la fonction répond à un besoin différent.  </p>
<p><strong><span style="color:#ff6600;">1. Créer une nouvelle variable à partir d&#8217;un sous-ensemble d&#8217;une autre</span></strong> : l&#8217;application la plus courante de la fonction SUBSTR consiste à conserver un sous-ensemble d&#8217;une chaîne de caractères, en se référant à sa position de départ et à sa longueur, pour définir une nouvelle variable.</p>
<p><strong>Notation :</strong> la fonction est composée de trois paramètres</p>
<ul>
<li>
<div>le nom de la variable d&#8217;origine, </div>
</li>
<li>
<div>la position du premier caractère qui nous intéresse,</div>
</li>
<li>
<div>le nombre total de caractères à partir du point de départ (optionnel).</div>
</li>
</ul>
<p><strong>Exemple</strong> : dans l&#8217;exemple suivant, imaginez une variable TESTCASE. Les tests tc0101, tc0102 appartiennent au même groupe, tandis que tc0201 appartient à un groupe différent. Les deux premiers chiffres font référence au groupe. Pour sauvegarder ces chiffres dans une variable GRP, on utilise la fonction <strong>SUBSTR</strong>.</p>
<p><span style="font-size:x-small;font-family:Courier New;">grp=substr(testcase,<strong><span style="color:#008080;">3</span></strong>,<strong><span style="color:#008080;">2</span></strong>);</span></p>
<p><strong>Note </strong>: Si le nombre de caractères à retenir n&#8217;est pas précisé par un troisième paramètre, c&#8217;est tout le reste de la chaîne à partir de la position donnée en second paramètre qui est conservé.</p>
<p><span style="font-size:x-small;font-family:Courier New;">grp=substr(testcase,<strong><span style="color:#008080;">3</span></strong>);</span></p>
<p><strong><span style="color:#ff6600;">2. Remplacer une partie d&#8217;une chaîne de caractères</span></strong> : pour actualiser une variable dans un data step, la démarche sous SAS est fastidieuse. Dans un cas particulier, cependant, on peut l&#8217;éviter : changer un sous-ensemble d&#8217;une variable texte défini par sa position dans la chaîne et sa longueur.</p>
<p><strong>Rappel, actualiser une variable dans un data step</strong> : dans un premier, la variable est renommée. Cette variable contient les valeurs d&#8217;origine, celle qui nous intéressent. On peut ainsi définir une nouvelle variable portant le nom d&#8217;origine puisque ce nom n&#8217;existe plus. Cette nouvelle variable prendra nos valeurs d&#8217;origine, plus les nouveautés voulues via une addition, une concaténation ou autre.</p>
<p><strong>Exemple :</strong> on reprend l&#8217;exemple de la première section avec notre variable TESTCASE. La chaîne  &#8217;tc&#8217; commençant en position 1 et longues de 2 est remplacée par les caractères &#8216;AB&#8217;.</p>
<p><span style="font-size:x-small;font-family:Courier New;">substr(testcase,<strong><span style="color:#008080;">1</span></strong>,<strong><span style="color:#008080;">2</span></strong>)=<span style="color:#800080;">&#8216;AB&#8217;</span>;</span></p>
<p><strong>Notez que la valeur de substitution doit être de la même longueur.</strong> Si elle est plus grande, les caractères seront ignorés. Si elle est plus petite, des blancs remplaceront les espaces manquants.  De plus, on ne peut substituer que parmi les caractères existants, blancs de début et fin de chaîne compris.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Finding opcodes in assembler source]]></title>
<link>http://rvdheij.wordpress.com/2007/10/04/finding-opcodes-in-assembler-source/</link>
<pubDate>Thu, 04 Oct 2007 09:50:49 +0000</pubDate>
<dc:creator>rvdheij</dc:creator>
<guid>http://rvdheij.wordpress.com/2007/10/04/finding-opcodes-in-assembler-source/</guid>
<description><![CDATA[I needed to pick some statements out of my assembler source based on the instruction (doing a quick ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I needed to pick some statements out of my assembler source based on the instruction (doing a quick &#38; dirty count of the number of branches in the source, so counting all statements where the opcode starts with a &#8220;B&#8221;). Since my source files are indented to show control structures, I cannot simply</p>
<pre>
  locate 9 ,B,</pre>
<p>Using <code>substr 1 of w1</code> will let me select records based on the first character in the first word, but this would fail when the statement also has a label. To fix that, I can do a destructive test by removing the optional label first.</p>
<pre>
  &#124; x: if nlocate 1 , ,
  &#124;   substr w2-*
  &#124; x:
  &#124; locate substr 1 of w1 ,B,</pre>
<p>While this might work for the initial purpose of counting the records, it does not work when I need to handle the selected records afterwards.<br />
So a non-destructive test is what I wanted. That is possible using the <code>if</code> as well.</p>
<pre>
  &#124; x: if nlocate 1 , ,
  &#124;   locate substr 1 of w1 ,B,
  &#124; x:
  &#124;   locate substr 1 of w2 ,B,
  &#124; x:</pre>
<p>Unfortunately, this has the same selection in two different places. As long as I am using the <code>locate</code> that is not much of a problem, but as soon as I need to use <code>lookup</code> it becomes horrible to have the selection in two different places. A much nicer pipeline is the following:</p>
<pre>
  &#124; insert ,*, before
  &#124; locate substr 1 of w2 ,B,
  &#124; substr 2-*</pre>
<p>While this isn&#8217;t really non-destructive, the change to the record is such that I can undo it easily. The <code>insert</code> prefixes the record with a character so that I am certain the opcode will be the second word (first word is either the &#8220;*&#8221; itself, or the original label prefixed by &#8220;*&#8221;).</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Javascript: substr() v.s. substring()]]></title>
<link>http://rapd.wordpress.com/2007/07/12/javascript-substr-vs-substring/</link>
<pubDate>Thu, 12 Jul 2007 22:34:25 +0000</pubDate>
<dc:creator>didip</dc:creator>
<guid>http://rapd.wordpress.com/2007/07/12/javascript-substr-vs-substring/</guid>
<description><![CDATA[substr() method extracts a specified number of characters in a string, from a start index. Syntax: s]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>substr() method extracts a specified number of characters in a string,  from a start index.</p>
<blockquote><p><strong>Syntax:</strong> string.substr(start, length);</p></blockquote>
<p>substring() method extracts the chars in a string between two  specified indexes.</p>
<blockquote><p><strong>Syntax:</strong> string.substring(start, stop);</p></blockquote>
<p><strong>Quick Notes aout Substr:</strong></p>
<ul>
<li>If start is negative, <strong>Internet Explorer</strong> returns the whole string. That&#8217;s wrong! IE should use the last character in the string.</li>
</ul>
<p><strong>Quick Notes about Substring:</strong></p>
<ul>
<li>If start equals stop<code>, </code>it returns an empty string.</li>
<li> If stop is omitted,  it extracts characters to the end of the string.</li>
<li> If either argument is less than 0 or is NaN, it is treated as if it were 0.</li>
<li> If either argument is greater than string&#8217;s length, either argument will use string&#8217;s length.</li>
<li>If start &#62; stop, then substring will swap those 2 arguments.</li>
</ul>
<p><strong>UPDATE (Added Slice upon request)</strong></p>
<p>slice() works like substring() with a few different behaviors.</p>
<blockquote><p><strong>Syntax:</strong> string.slice(start, stop);</p></blockquote>
<p><strong>Quick Notes about Slice:</strong></p>
<ul>
<li>If stop is omitted, slice extracted chars to the end of the string, exactly like substring().</li>
<li>If start &#62; stop, slice() will NOT swap the 2 arguments.</li>
<li>If start is negative, slice() will set char from the end of string, exactly like substr() in Firefox. This behavior is observed in both Firefox and IE.</li>
<li>If stop is negative, slice() will set stop to: <em>(string.length &#8211; 1) &#8211; stop (original value)</em>.</li>
</ul>
<p><strong>References:</strong></p>
<ul>
<li><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:String:substr" target="_blank">Mozilla Developer Documentation &#8211; substr()</a></li>
<li><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:String:substring" target="_blank">Mozilla Developer Documentation &#8211; substring()</a></li>
<li><a href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:String:slice" target="_blank">Mozilla Developer Documentation &#8211; slice()</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/0esxc5wy.aspx" target="_blank">MSDN Documentation &#8211; substr()</a></li>
<li><a href="http://msdn2.microsoft.com/en-us/library/3cz15ahb.aspx" target="_blank">MSDN Documentation &#8211; substring()</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/6w1bzf9f(VS.85).aspx" target="_blank">MSDN Documentation &#8211; slice()</a></li>
<li><a href="http://www.opera.com/docs/specs/js/ecma/" target="_blank">Opera ECMAScript &#38;/ Javascript Support (including Opera for Wii)</a></li>
</ul>
<p><!--more--><!--more--></p>
</div>]]></content:encoded>
</item>

</channel>
</rss>
