Jonkman Microblog
  • Login
Show Navigation
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Michael F. Lamb (datagrok@tiny.tilde.website)'s status on Thursday, 09-Nov-2017 16:20:45 EST Michael F. Lamb Michael F. Lamb

    @archangelic so you want to take a string with embedded spaces and newlines and turn it into several strings each no longer than n characters without breaking mid-word?

    something like this might work, or at least be a starting point (here, the limit is 140 characters)

    re.findall('.{,139}(?:\s|$)', input_text)

    the idea is "find all strings of characters up to 139 characters followed by either space or newline"

    In conversation Thursday, 09-Nov-2017 16:20:45 EST from tiny.tilde.website permalink
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

Jonkman Microblog is a social network, courtesy of SOBAC Microcomputer Services. It runs on GNU social, version 1.2.0-beta5, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All Jonkman Microblog content and data are available under the Creative Commons Attribution 3.0 license.

Switch to desktop site layout.