Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1020563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:10:55+00:00 2026-05-16T11:10:55+00:00

I have a String made up of several Strings seperated by commas. Using StringTemplate,

  • 0

I have a String made up of several Strings seperated by commas. Using StringTemplate, is there an easy way to write a seperate line for each ‘value’ in this outer String?

For example, I have:

String layers = "ADM,NAV";

and I want to output:

ADM,Y,
NAV,Y,

I suspect the template would look (if it’s possible) something like this:

$layers.split(","): {layer | $layer$,Y, }$

Here’s a somewhat-possibly related example I found of how write a line for each object in a collection:

<ul>
    $orders: {order|
        <li>Order $order.OrderId$</li>
    }$
</ul>

However, I cannot just build a collection out of the String in my Java code – it must remain a comma-seperated String. Any ideas?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:10:55+00:00Added an answer on May 16, 2026 at 11:10 am

    It is not possible according to the philosophy of StringTemplate: template engine’s purpose is to separate representation from business logic. In your case splitting string is business logic and cannot be performed in template.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made a String[] array by using String.split(.) . I am now trying
String a=(Yeahhhh) I have finally made it to the (top); Given above String, there
I have an Excel spreadsheet containing a list of strings. Each string is made
I have made a string vector vector<string> actor_; and then added elements in it
I have a database with a ValidDate field - it's a string(we made a
I have made a tree structure using c and used it for storing some
In a MySQL table, I have several columns - some containing strings, some dates
I have been following several tutorials that have made me succeed in getting information
Let's say I have a JavaScript object that is made up of several key/value
I have just ported several of our home-made Outlook COM-addins from Delphi 2007 to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.