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

  • Home
  • SEARCH
  • 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 8515091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:03:00+00:00 2026-06-11T05:03:00+00:00

Obviously using the array.split function is very easy to use to separate lines of

  • 0

Obviously using the array.split function is very easy to use to separate lines of text by using "\n" or "\r" — however, when pasting data in from a word document, this does not identify nor split the linebreaks.

So just wondering, how can I make it so that the pasted contents of a word document can be separated by line? Obviously, I can’t copy/paste the linebreak from MS Word as this breaks the code (the compiler won’t have a bar of it), so I was wondering if there was a simple method of splitting text of this variation?

I can upload a .swf if necessary — I’m unsure if my explanation so far is reasonable. Basically, using the enter key in the text content results in recognisation of the linebreak, whereas pasting from MS Word does not.

Thanks all.

  • 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-11T05:03:02+00:00Added an answer on June 11, 2026 at 5:03 am

    you could paste the sample of that text – or make available the file you are using, but you can try following:

    var reg:RegExp = /(\r\n|\n|\r)/gm;
    var lines:Array = source.split(reg);
    

    where source is the string text from word

    The regular expression above matches the windows style new line, then *nix and OSX type, then Mac OS 9 type. Windows new line is made of 2 cariage return and line feed but flash treats it separately in result you can get double line break in flash.

    Also importatn thing is that line break and wrapped line is something different:) so it can be that in word you have line wrapped but it is one long line without any line breaks.

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

Sidebar

Related Questions

I have to allocate a struct from within another function, obviously using pointers. I've
i'm trying to use php to split a string into array components using either
Anyone install both? Using each for separate projects obviously. Shouldn't be a problem, I'm
Please help. I am obviously no expert but using suggestions from this site, I
I'm subclassing Array using prototype, in this way: MyArray = function() { Array.apply(this, arguments);
How does one access data imported from a CSV file by using dynamic note
I am using WCF RIA services with silverlight. Obviously I am using this primarily
Obviously the point of using named constants over magic numbers is for code clarity
I'm using the Django manage.py runserver for developing my application (obviously), but it takes
I'm using a streaming distribution on CloudFront to serve media via RTMP. Obviously 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.