Jump to content
Sign in to follow this  
Adele

String Split By Line

Recommended Posts

Adele

I have a string and I want split it by line. I have tried these codes on that topic from but the correct results don't return when it has made _ArrayDisplay. '?do=embed' frameborder='0' data-embedContent>>

kodevreni_1422641585__screenshot_2.png

$aResult = StringSplit($YourString,@CRLF,1)
StringRegExp ($sData, "(?:\s*)?(.+)(?:\n)?", 3)
Func _StringGetLine ($sString, $iLine, $bCountBlank = False)
   Local $sChar = "+"
   If $bCountBlank = True Then $sChar = "*"
   If Not IsInt ($iLine) Then Return SetError (1, 0, "")
   Return StringRegExpReplace ($sString, "((." & $sChar & "\n){" & $iLine - 1 & "})(." & $sChar & "\n)((." & $sChar & "\n?)+)", "\2")
EndFunc ; ==> _StringGetLine

When I display the string with MsgBox(), there is no problem.

kodevreni_1422641554__screenshot_1.png

My codes:

$sRead = StringSplit($sString, @CRLF)
MsgBox(0, "", $sString)
_ArrayDisplay($sRead)

I need your help. Thank you in advance.

Edited by Adele

Share this post


Link to post
Share on other sites
Valuater

Try splitting with 

@CR

or

@LF

8)

  • Like 1

NEWHeader1.png

Share this post


Link to post
Share on other sites
Adele

The problem had been on the string :). I have realized just now. The topic has fixed. Thank you to everyone.

Edited by Adele

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×