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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:19:48+00:00 2026-05-25T06:19:48+00:00

I use VB.NET to create data for my game (for Android, Java code), this

  • 0

I use VB.NET to create data for my game (for Android, Java code), this is how it look like:

5;0000000100011100010000000;2;2
5;1000001100010000000000000;0,1;0,1

where each line is a level. In VB.NET, I create new line by vbNewLine constant (I think its ASCII code is 13) then use IO.File.WriteAllText to write it to the file.

In my game in Java, I use \n to split the levels:

String[] levelData = rawData.split("\n");

However, when processing throught the data, the levelData always has a “new line” after the end. For example, the levelData[0] is 5;00...2;2<new line>, which cause Integer.parseInt exception. Then I debug, and found this:

rawData.charAt(31) //It's a \r, not \n

So, I change the split line:

String[] levelData = rawData.split("\r");

But now, the levelData[1] will be <newline>5....

What exactly do I have to do to solve this problem? And please explain how “new line” work in Java String.

  • 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-25T06:19:49+00:00Added an answer on May 25, 2026 at 6:19 am

    Most probably it is from the code you show in VB that is the problem.

    I create new line by vbNewLine constant (I think its ASCII code is 13)

    First verify this for certain, then look up what code 13 is! Here is a general ascii table.

    code 13 is a carrige return and is represented in Java as \r

    code 10 is line feed and is represented in Java as \n

    A good tip would be to read up a little about NewLines, It’s completely fu**ed up, Windows and Linux uses different ways of representing a new line.

    • CR+LF: Microsoft Windows, DEC TOPS-10, RT-11 and most other early non-Unix and non-IBM OSes, CP/M, MP/M, DOS (MS-DOS, PC-DOS, etc.), Atari TOS, OS/2, Symbian OS, Palm OS
    • LF: Multics, Unix and Unix-like systems (GNU/Linux, AIX, Xenix, Mac OS X, FreeBSD, etc.), BeOS, Amiga, RISC OS, and others.
    • CR: Commodore 8-bit machines, Acorn BBC, TRS-80, Apple II family, Mac OS up to version 9 and OS-9
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use Visual Studio .NET to create a Windows-based application. The application includes a
I am trying to create a .NET DLL so I can use the cryptographic
I use Visual Studio .NET to develop internal applications. I create a Windows control
I am trying to use the System.Net.Mail.MailMessage class in C# to create an email
I create new ASP.NET web application that use SMTP to send message. The problem
I use Unmanaged Exports to create a native .dll from .NET .dll so I
I want to create a vb.net project that I will use to only hold
In the Full .NET framework you can use the Color.FromArgb() method to create a
I'm trying to use a view to create an ADO.NET entity using a view.
There are some updates with .NET 3.0 concerning how to create and use add-ins

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.