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 7975415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T08:37:54+00:00 2026-06-04T08:37:54+00:00

How do i use split or stringtokenizer to get only the 1st character of

  • 0

How do i use split or stringtokenizer to get only the 1st character of each word to create an acronym? It would also include the ‘&’ symbol. And it isn’t case sensitive

exmaple:

  • Some Kind Of Long String —> SKOLS
  • another Kind of Long String —> AKOLS
  • string & string —> s&s

The reason for this is because i have a query that populates a table, and since the column name are 3 or more words each. it stretches the table, even with a scroll bar placed, 100+ columns with long names would make it look really long. So i would like to reduce space by using only acronyms and generating a legend.

  • 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-06-04T08:37:55+00:00Added an answer on June 4, 2026 at 8:37 am

    First you need to split the String at either ” ” or “&”.

    You can use the “split” method for String. http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#split(java.lang.String)

    The regular expression would be either space or ampersand.
    Then you would use the charAt method to get the character at index 0. You would concatenate the characters to get the acronym.

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

Sidebar

Related Questions

I'm trying to use PHP's split() (preg_split() is also an option if your answer
I have a string build form comma separated values I use split to get
How do I use the split function to split by \.? For example, first
I have a class I use to split a string of SQL commands by
I use the following to split my strings into usable information sscanf(last, %*[^:]:%*[^:]:%*[^:]:%127[^:]:, field_x);
I use the regex [,;\s]+ to split a comma, space, or semicolon separated string.
How do i use javascript/jquery to select all $('td.created') and split the html on
Is it any faster to use myString.replace(/foo/g,bar) rather than myString.split(foo).join(bar) for long strings in
I have a code use Tie::File::AsHash; tie %sets, 'Tie::File::AsHash', '.\\main\\old_names.txt', split => '\+' or
I have a SPList object and use SPList.Items to get the SPListItemCollection. From this

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.