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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:18:24+00:00 2026-06-04T17:18:24+00:00

I need to have a cross-platform newline reference to parse files, and I’m trying

  • 0

I need to have a cross-platform newline reference to parse files, and I’m trying to find a way to do the equivalent of the usual

System.getProperty("line.separator");

but trying that in J2ME, I get a null String returned, so I’m guessing line.separator isn’t included here. Are there any other direct ways to get a universal newline sequence in J2ME as string?

edit: clarified question a bit

  • 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-04T17:18:25+00:00Added an answer on June 4, 2026 at 5:18 pm

    Seems like I forgot to answer my question. I used a piece of code that allowed me to use “\r\n” as delimiter and actually considered \r and \n as well seperately:

    public class Tokenizer {
       public static String[] tokenize(String str, String delimiter) {
    
           StringBuffer strtok = new StringBuffer();
           Vector buftok = new Vector();
    
           char[] ch = str.toCharArray();                       //convert to char array
           for (int i = 0; i < ch.length; i++) {
    
               if (delimiter.indexOf(ch[i]) != -1) {   //if i-th character is a delimiter               
                   if (strtok.length() > 0) {
                       buftok.addElement(strtok.toString());
                       strtok.setLength(0);
                   }
               } 
               else {
                   strtok.append(ch[i]);
               }
           }
    
           if (strtok.length() > 0) {
               buftok.addElement(strtok.toString());
           }
    
    
           String[] splitArray = new String[buftok.size()];
           for (int i=0; i < splitArray.length; i++) {
               splitArray[i] = (String)buftok.elementAt(i);
           }
           buftok = null;
    
           return splitArray;
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to build some cross platform cpp files in my android mk file.
I have a need for a cross-platform (hopefully C) library that can create and
We need a cross platform solution for compressing files. Our server runs on Windows
I'm using pthreads-win32 to allow threading support for windows. I have a cross platform
we're building a cross-platform utility which must have a small footprint. We've been pulling
I am trying to write a cross-platform python program that would run in the
I have a very large binary file and I need to create separate files
I have a few years of experience in cross-platform desktop development (Windows and MacOSX,
I like F# but sometimes I need something light and cross-platform and without .NET
I've making a shared library (cross-platform), but when trying to compile the Windows build

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.