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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:03:00+00:00 2026-06-14T19:03:00+00:00

hello every one i got a string from csv file like this LECT-3A,instr01,Instructor 01,teacher,instr1@learnet.com,,,,male,phone,,

  • 0

hello every one i got a string from csv file like this

LECT-3A,instr01,Instructor 01,teacher,instr1@learnet.com,,,,male,phone,,

how to split this string with comma i want the array like this

 s[0]=LECT-3A,s[1]=instr01,s[2]=Instructor 01,s[3]=teacher,s[4]=instr1@learnet.com,s[5]=,s[6]=,s[7]=,s[8]=male,s[9]=phone,s[10]=,s[11]=

can anyone please help me how to split the above string as my array

thank u inadvance
  • 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-14T19:03:01+00:00Added an answer on June 14, 2026 at 7:03 pm

    you can use the limit parameter to do this:

    The limit parameter controls the number of times the pattern is applied and therefore affects the length of the resulting array. If the limit n is greater than zero then the pattern will be applied at most n – 1 times, the array’s length will be no greater than n, and the array’s last entry will contain all input beyond the last matched delimiter. If n is non-positive then the pattern will be applied as many times as possible and the array can have any length. If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded.

    Example:

    String[]
    ls_test = "LECT-3A,instr01,Instructor 01,teacher,instr1@learnet.com,,,,male,phone,,".split(",",12);
    
    int cont = 0;
    
    for (String ls_pieces : ls_test)
        System.out.println("s["+(cont++)+"]"+ls_pieces);
    

    output:

    s[0]LECT-3A
    s[1]instr01
    s[2]Instructor 01
    s[3]teacher
    s[4]instr1@learnet.com
    s[5]
    s[6]
    s[7]
    s[8]male
    s[9]phone
    s[10]
    s[11]

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

Sidebar

Related Questions

Hello every one this is extension to my previous question.Here is the link File
hello every one i have table view with one cell,and i make on this
hello every one i face this problem and iam too weak in DB i
hello every one i am using this code to give glowing effect to my
Hello every one I want to ask a question about file transfer using sockets.
Hello every one, While taking back up of the database, i got the above
hello every one i want to pass the php array from the javascript function
Hello every One i am trying to get Ist date of All months in
Hello every one I want to ask a question that what is simple exec
Hello every one I have wrote a simple code in html5 in which I

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.