The Artima Developer Community
Sponsored Link

Java Buzz Forum
4-line Java word wrapping code

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Keith Lea

Posts: 159
Nickname: leaklea
Registered: Jun, 2003

Keith Lea develops joscar, an open-source Java library for AOL Instant Messenger's OSCAR protocol.
4-line Java word wrapping code Posted: Dec 30, 2003 12:35 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Keith Lea.
Original Post: 4-line Java word wrapping code
Feed Title: joustlog
Feed URL: http://joust.kano.net/weblog/feed/rss2/
Feed Description: Weblog for the Joust project, a Java AIM client and library.
Latest Java Buzz Posts
Latest Java Buzz Posts by Keith Lea
Latest Posts From joustlog

Advertisement
I had this crazy idea for implementing 80-character word wrapping, and it seems like it works fine so far:private static final Pattern wrapRE = Pattern.compile(".{0,79}(?:\\S(?:-| |$)|$)"); private static String[] wordWrap(String str) { List list = new LinkedList(); Matcher m =...

Read: 4-line Java word wrapping code

Topic: Links Previous Topic   Next Topic Topic: London Java Meetup - Xmas Party 2003

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use