<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: manipulation code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 17 May 2008 09:50:09 GMT</pubDate>
    <description>DZone Snippets: manipulation code</description>
    <item>
      <title>Java: RegEx: Splitting a space-, comma-, and semi-colon separated list</title>
      <link>http://snippets.dzone.com/posts/show/4389</link>
      <description>// Greedy RegEx quantifier used&lt;br /&gt;//   X+ = X, one or more times&lt;br /&gt;//   [\\s,;]+ = one or more times of either \s , or ;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;    String test_data = "hello world, this is a test, ;again";&lt;br /&gt;    _logger.debug("Source: " + test_data);&lt;br /&gt;    &lt;br /&gt;    for (String tag : test_data.split("[\\s,;]+"))&lt;br /&gt;    {&lt;br /&gt;      _logger.debug("Received tag: [" + tag + "]");&lt;br /&gt;    }&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 05 Aug 2007 05:28:17 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4389</guid>
      <author>thitiv (Thiti V. Sintopchai)</author>
    </item>
    <item>
      <title>Java: RegEx to Remove HTML Tags</title>
      <link>http://snippets.dzone.com/posts/show/4018</link>
      <description>// Ref: https://jalbum.net/forum/thread.jspa?forumID=7&amp;threadID=971&amp;messageID=6907&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;String noHTMLString = htmlString.replaceAll("\\&lt;.*?\\&gt;", "");&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Tue, 15 May 2007 04:19:12 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4018</guid>
      <author>thitiv (Thiti V. Sintopchai)</author>
    </item>
    <item>
      <title>JavaScript: String Tokenization and Substring</title>
      <link>http://snippets.dzone.com/posts/show/3608</link>
      <description>// Tokenize a comma-separated string &lt;br /&gt;// then recreate the comma-separated list&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;  var currentTagTokens = currentTags.split( "," );&lt;br /&gt;  var existingTags = "";&lt;br /&gt;&lt;br /&gt;  for ( var i = 0; i &lt; currentTagTokens.length; i++ )&lt;br /&gt;  {&lt;br /&gt;    existingTags = existingTags + currentTagTokens[ i ] + ", ";&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  // Remove the trailing ", " from existingTags&lt;br /&gt;  existingTags = existingTags.substring( 0, existingTags.length - 3 ); &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 01 Mar 2007 11:01:14 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3608</guid>
      <author>thitiv (Thiti V. Sintopchai)</author>
    </item>
    <item>
      <title>JavaScript String Tokenization</title>
      <link>http://snippets.dzone.com/posts/show/3485</link>
      <description>//&lt;br /&gt;// String Tokenization with JavaScript&lt;br /&gt;// From http://www.thescripts.com/forum/thread91795.html&lt;br /&gt;// &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;function makeArray( strLongString )&lt;br /&gt;{&lt;br /&gt;  return strLongString.split( "," );&lt;br /&gt;}&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 09 Feb 2007 15:50:40 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3485</guid>
      <author>thitiv (Thiti V. Sintopchai)</author>
    </item>
    <item>
      <title>image manipulation in linux</title>
      <link>http://snippets.dzone.com/posts/show/2693</link>
      <description>&lt;code&gt;&lt;br /&gt;for file in *.jpg&lt;br /&gt;      do&lt;br /&gt;      cp $file $file.orig&lt;br /&gt;      convert -resize 800x600 $file.orig $file&lt;br /&gt;done&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;</description>
      <pubDate>Sat, 23 Sep 2006 18:19:58 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2693</guid>
      <author>nevadalife (nevada)</author>
    </item>
    <item>
      <title>smart plaintext wrapping</title>
      <link>http://snippets.dzone.com/posts/show/2589</link>
      <description>From http://blog.evanweaver.com/articles/2006/09/03/smart-plaintext-wrapping:&lt;br /&gt;&gt;&gt;&gt;&lt;br /&gt;Very often you need to break plaintext at a specific width while retaining readability. &lt;br /&gt;&lt;code&gt;&lt;br /&gt;#!/opt/local/bin/ruby&lt;br /&gt;&lt;br /&gt;class String&lt;br /&gt;&lt;br /&gt;  def wrap(width, hanging_indent = 0, magic_lists = false)&lt;br /&gt;    lines = self.split(/\n/)&lt;br /&gt;&lt;br /&gt;    lines.collect! do |line|&lt;br /&gt;&lt;br /&gt;      if magic_lists &lt;br /&gt;        line =~ /^([\s\-\d\.\:]*\s)/&lt;br /&gt;      else &lt;br /&gt;        line =~ /^([\s]*\s)/&lt;br /&gt;      end&lt;br /&gt;&lt;br /&gt;      indent = $1.length + hanging_indent rescue hanging_indent&lt;br /&gt;&lt;br /&gt;      buffer = ""&lt;br /&gt;      first = true&lt;br /&gt;&lt;br /&gt;      while line.length &gt; 0&lt;br /&gt;        first ? (i, first = 0, false) : i = indent              &lt;br /&gt;        pos = width - i&lt;br /&gt;&lt;br /&gt;        if line.length &gt; pos and line[0..pos] =~ /^(.+)\s/&lt;br /&gt;          subline = $1&lt;br /&gt;        else &lt;br /&gt;          subline = line[0..pos]&lt;br /&gt;        end&lt;br /&gt;        buffer += " " * i + subline + "\n"&lt;br /&gt;        line.tail!(subline.length)&lt;br /&gt;      end&lt;br /&gt;      buffer[0..-2]&lt;br /&gt;    end&lt;br /&gt;&lt;br /&gt;    lines.join("\n")&lt;br /&gt;&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;  def tail!(pos)&lt;br /&gt;    self[0..pos] = ""&lt;br /&gt;    strip!&lt;br /&gt;  end&lt;br /&gt;&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;if __FILE__ == $0&lt;br /&gt;  File.open(ARGV[0]) do |f|&lt;br /&gt;    puts f.read.wrap(ARGV[1].to_i, ARGV[2].to_i, ARGV[3] == "true")&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;&lt;&lt;</description>
      <pubDate>Wed, 13 Sep 2006 19:48:26 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/2589</guid>
      <author>MattScilipoti (Matt Scilipoti)</author>
    </item>
  </channel>
</rss>
