
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Word Wrap in Processing</title>
	<atom:link href="http://www.shiffman.net/2006/10/17/word-wrap-in-processing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shiffman.net/2006/10/17/word-wrap-in-processing/</link>
	<description></description>
	<lastBuildDate>Wed, 08 Feb 2012 06:20:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Daniel</title>
		<link>http://www.shiffman.net/2006/10/17/word-wrap-in-processing/comment-page-1/#comment-4568</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Tue, 17 Oct 2006 22:12:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.shiffman.net/2006/10/17/word-wrap-in-processing/#comment-4568</guid>
		<description>Ah, cool, thanks for the suggestions all!  This was my quick and dirty solution . . .</description>
		<content:encoded><![CDATA[<p>Ah, cool, thanks for the suggestions all!  This was my quick and dirty solution . . .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: seltar</title>
		<link>http://www.shiffman.net/2006/10/17/word-wrap-in-processing/comment-page-1/#comment-4565</link>
		<dc:creator>seltar</dc:creator>
		<pubDate>Tue, 17 Oct 2006 20:17:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.shiffman.net/2006/10/17/word-wrap-in-processing/#comment-4565</guid>
		<description>Got my own version which returns a string with linebreaks:

&lt;pre&gt;
  public String WordWrap(String strText, int iWidth){

    if( strText.length() = iLineNO){
      for(int iEn = iLineNO; iEn &gt; 1; iEn--){         // work backwards from the max len to 1 looking for a space
        sChar = sResult.charAt(iEn);
        if(sChar == \&#039; \&#039;){             // found a space
          sResult = remove(sResult, iEn , 1);     // Remove the space
          sResult = insert(sResult, iEn, \&quot;\\n\&quot;);     // insert a line feed here,
          iLineNO  = iWidth;             // increment
          lines  ;
          break;
        }
      }
    }
    return sResult;
  }

  public String remove(String str, int pos, int len){
    String ret = \&quot;\&quot;;
    for(int i = 0; i =pos &amp;&amp; i
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Got my own version which returns a string with linebreaks:</p>
<pre>
  public String WordWrap(String strText, int iWidth){

    if( strText.length() = iLineNO){
      for(int iEn = iLineNO; iEn > 1; iEn--){         // work backwards from the max len to 1 looking for a space
        sChar = sResult.charAt(iEn);
        if(sChar == \' \'){             // found a space
          sResult = remove(sResult, iEn , 1);     // Remove the space
          sResult = insert(sResult, iEn, \"\\n\");     // insert a line feed here,
          iLineNO  = iWidth;             // increment
          lines  ;
          break;
        }
      }
    }
    return sResult;
  }

  public String remove(String str, int pos, int len){
    String ret = \"\";
    for(int i = 0; i =pos &#038;&#038; i
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: JohnG</title>
		<link>http://www.shiffman.net/2006/10/17/word-wrap-in-processing/comment-page-1/#comment-4563</link>
		<dc:creator>JohnG</dc:creator>
		<pubDate>Tue, 17 Oct 2006 19:52:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.shiffman.net/2006/10/17/word-wrap-in-processing/#comment-4563</guid>
		<description>I think it might be more efficient to start at maxWidth, and work backwards looking for a space, rather than from the start working forwards finding the last space before the end.</description>
		<content:encoded><![CDATA[<p>I think it might be more efficient to start at maxWidth, and work backwards looking for a space, rather than from the start working forwards finding the last space before the end.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

