Sign in to follow this  
Followers 0
Cap0

how would i do this?

6 posts in this topic

i have a string:

cop top stop test big

fire bush ranger

and so on.

how would i make it turn out like:

cop

top

stop

test

big

fire

bush

ranger

Thanks.

Share this post


Link to post
Share on other sites



i have a string:

cop top stop test big

fire bush ranger

and so on.

see help file StringSplit().

#include <array.au3>
$text = "cop top stop fop mop"
$array = StringSplit($text, ' ')
_ArrayDisplay($array,"Test")

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i have a string:

cop top stop test big

fire bush ranger

and so on.

how would i make it turn out like:

cop

top

stop

test

big

fire

bush

ranger

Thanks.

You mean line breaks?

Try this:

Global $Message=""
$String = StringSplit("cop top stop test big fire bush ranger", " ")
For $i = 1 to $String[0]
$Message = $Message & $String[$i]&@CRLF
Next
MsgBox(0,"Results",$Message)

_ArrayDisplay is cheap! :)

Edited by Paulie

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Why not:

$newstring = StringReplace($string, " ", @CRLF)
Msgbox(0,"",$newstring)

Kurt

EDIT: WOOT 300 POSTS.. personal title here we come!

Edited by _Kurt

Awaiting Diablo III..

Share this post


Link to post
Share on other sites

_ArrayDisplay is cheap! :)

no it's elegant. Why reinvent the wheel???


__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Share this post


Link to post
Share on other sites

Sorry for the late reply;

thanks, those methods work :)

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  
Followers 0