Jump to content

Removing line feed in a string


faldo
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Developers

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 etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

$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:

Link to comment
Share on other sites

#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.

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...