Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: Cut in string at X characters but not inside words

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2015

    Question Cut in string at X characters but not inside words

    Hello all,

    I'm looking to do a certain transformation to a long string text. I have a string of for example 70+ Characters and want to limit it to always maximum 70 characters. If there are more characters it should split it to the next row and continue to do so until the string is cut in lengths of 70 characters max.

    This is not difficult to do with a cut in strings step, however the cut in string step could potentially cut in the middle of a word. I do not want this. It should break up the string after a space, so in my case the first space at the end before 70 characters. This way words will not be broken up and all sentences are nicely split.

    Could anyone give an example of this with one of the steps, or a javascript for this?

    Thanks in advance!
    Last edited by Dutchsky; 10-12-2018 at 05:05 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.