Jump to content
Sign in to follow this  
faldo

Removing line feed in a string

Recommended Posts

faldo

I'm useing GUICtrlCreateEdit () with "$ES_MULTILINE" as style to create an editbox in a GUI.

But when i use GUICtrlRead() to get the message in the box, the string i get in return has some kind of hidden line feed control i can't get rid of.

The reason i want to remove the line feed is that i want to put the string into a ini file that don't support line feeds.

Is there a way to remove the line feed or somehow change the @CRLF to some other character?

Please help :lmao:

Edited by faldo

Share this post


Link to post
Share on other sites
Jos

I'm useing GUICtrlCreateEdit () with "$ES_MULTILINE" as style to create an editbox in a GUI.

But when i use GUICtrlRead() to get the message in the box, the string i get in return has some kind of hidden line feed control i can't get rid of.

The reason i want to remove the line feed is that i want to put the string into a ini file that don't support line feeds.

Is there a way to remove the line feed or somehow change the @CRLF to some other character?

Please help :lmao:

$yourstring = StringReplace($yourstring,@lf,"")

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
faldo

$yourstring = StringReplace($yourstring,@lf,"")oÝ÷ Ûú®¢×¢ØZµÚ²}ý¶ÇÚ0¢¹µ©eêÞßÛ0«bv'ZºÚ"µÍÚ[ÛYH    ÑÕRPÛÛÝ[Ë]LÉÝÂÕRPÜX]J    ][ÝÓ^HÕRHY]  ][ÝÊBÌÍÛ^YY]QÕRPÝÜX]QY]
    ][ÝÑÝ[I][ÝÉ[ÈÔLÌLKMË   ÌÍÑT×ÐUUÕÐÔÓ
ÉÌÍÑT×ÓUSSSJÉÌÍÑT×ÕÐSUTBÕRPÝÙ]]H
    ÌÍÛ^YY]  ][ÝÔÙXÛÛ[I][ÝËJBÌÍÐÚXÚÈHÕRPÝÜX]P]Û ][ÝÈÚXÚÈ   ][ÝË
LÌ
LJBÕRTÙ]Ý]H

BÚ[HBIÌÍÛÙÈHÕRQÙ]ÙÊ
BRY ÌÍÛÙÈH ÌÍÐÚXÚÈ[ÙÐÞ
    ][ÝÑÙ]Ý[ÈÛHY]Þ   ][ÝËÝ[ÔXÙJÕRPÝXY
    ÌÍÛ^YY]
K   ][ÝÉ][ÝÊJBRY    ÌÍÛÙÈH ÌÍÑÕRWÑUSÐÓÔÑH[^]ÛÜÙ[

The string still shows up as two lines :lmao:

Share this post


Link to post
Share on other sites
GaryFrost

#include <GUIConstants.au3>

GUICreate("My GUI edit")
$myedit=GUICtrlCreateEdit ("First line"& @CRLF, 10,32,121,97,$ES_AUTOVSCROLL+$ES_MULTILINE+$ES_WANTRETURN)
GUICtrlSetData ($myedit, "Second line",1)
$Check = GUICtrlCreateButton(" Check ", 50, 320, 50, 25)
GUISetState ()

While 1
    $msg = GUIGetMsg()
    If $msg = $Check then MsgBox(0, "Get string from Editbox", StringReplace(GUICtrlRead($myedit),@CRLF,""))
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
MHz

Is there a way to remove the line feed or somehow change the @CRLF to some other character?

Please help :ph34r:

:lmao:

evaluates to...

Is there a way to remove the @LF or somehow change the @CRLF to some other character?

so JdeB got the 1st request correct. Seems like you should have requested only the @CRLF (carriage return and the line feed) to be removed for your expectation. Edited by MHz

Share this post


Link to post
Share on other sites
faldo

Sorry i made it abit unclear, the @CRLF in my example had nothing to with my question...

The real question was what kind of line feed the style "$ES_MULTILINE" returned when you changed line... and @CRLF was the answer, thanx alot guys.

Edited by faldo

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  

×