String Things - Stand-alone string manipulation functions

Post your working scripts, libraries and tools
User avatar
tidbit
Posts: 984
Joined: 29 Sep 2013, 17:15
Location: USA

String Things - Stand-alone string manipulation functions

01 Oct 2013, 09:19

String Things v2.6
A collection of commonly needed functions for working with strings and arrays.

There are better descriptions and an example for each function in the comments of the code.
Download

Code: [Select all] [Expand] [Download] (Script.ahk)GeSHi © Codebox Plus



Log:
Spoiler
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
tidbit
Posts: 984
Joined: 29 Sep 2013, 17:15
Location: USA

Re: String Things - Stand-alone string manipulation function

27 Dec 2013, 15:29

added st_columnize(data [, delim, justify, pad, colsep]) Screenshot
afterlemon updated st_substring()
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
tidbit
Posts: 984
Joined: 29 Sep 2013, 17:15
Location: USA

Re: String Things - Stand-alone string manipulation function

28 Dec 2013, 11:43

2.4
added st_center()
added st_right()

They are simple justification functions, no fancy bells-and-whistles.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
tidbit
Posts: 984
Joined: 29 Sep 2013, 17:15
Location: USA

Re: String Things - Stand-alone string manipulation function

02 Jan 2014, 12:57

2.5
Nameless-exe fixed, shorted and optimized st_jumble()!

Edit:
I just undid his changes. they were flawed :P instead I fixed a minor bug with the weight grouping.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
User avatar
joedf
Posts: 5819
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: String Things - Stand-alone string manipulation function

06 Mar 2014, 11:08

nice-o!
User avatar
tidbit
Posts: 984
Joined: 29 Sep 2013, 17:15
Location: USA

Re: String Things - Stand-alone string manipulation function

07 Mar 2014, 11:09

Thanks guys! :D
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: String Things - Stand-alone string manipulation function

07 Mar 2014, 18:34

download link NOT working... :cry:
User avatar
joedf
Posts: 5819
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: String Things - Stand-alone string manipulation function

07 Mar 2014, 18:38

Guest10 wrote:download link NOT working... :cry:

Right-click Link and Save as... ???
User avatar
tidbit
Posts: 984
Joined: 29 Sep 2013, 17:15
Location: USA

Re: String Things - Stand-alone string manipulation function

08 Mar 2014, 10:34

Works for me. Even a normal click. Was probably just some downtime.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: String Things - Stand-alone string manipulation function

08 Mar 2014, 14:10

it always says, "Problem loading page"
The connection has timed out

The server at tidbit.3owl.com is taking too long to respond.

The site could be temporarily unavailable or too busy. Try again in a few
moments.
If you are unable to load any pages, check your computer's network
connection.
If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.
ozzii
Posts: 286
Joined: 30 Oct 2013, 06:04

Re: String Things - Stand-alone string manipulation function

10 Mar 2014, 08:13

Working for me right now : 14:13 CET
User avatar
joedf
Posts: 5819
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: String Things - Stand-alone string manipulation function

27 May 2014, 20:04

Code: [Select all] [Download] (sprintf.ahk)GeSHi © Codebox Plus

sprintf(msg, vargs*) {
for each, varg in vargs
StringReplace,msg,msg,`%s, % varg ;msg:=RegExReplace(msg,"i)`%.",varg)
return msg
}

mystring := sprintf("Hello %s!","joedf")


? :D
Guest10
Posts: 578
Joined: 01 Oct 2013, 02:50

Re: String Things - Stand-alone string manipulation function

27 May 2014, 21:32

tried again to download. looks like i have to sign up. do i have to sign up to upload this script? :lol:
Verdlin
Posts: 61
Joined: 04 Oct 2013, 08:55
GitHub: Aatoz

Re: String Things - Stand-alone string manipulation function

28 May 2014, 04:42

Thanks, Joe. It's actually slightly different than that.

Code: [Select all] [Download] (Script.ahk)GeSHi © Codebox Plus

{
Msgbox % st_Concat("|", 1, 2, 3, 4,5 ,6)
return
}

st_Concat(delim, as*)
{
for k, v in as
s .= v . delim
return s
}
User avatar
joedf
Posts: 5819
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: String Things - Stand-alone string manipulation function

28 May 2014, 05:37

Ahh ok :O :)
User avatar
tidbit
Posts: 984
Joined: 29 Sep 2013, 17:15
Location: USA

Re: String Things - Stand-alone string manipulation function

28 May 2014, 09:32

joedf: sprintf already exists in ST :D st_format(). I think I went off the PHP name, can't remember.
Verdlin: Will add that!

There will be an update sooner or later. I've made some other minor changes aswell.
rawr. fear me.
*poke*
Is it December 21, 2012 yet?
guest3456
Posts: 2023
Joined: 09 Oct 2013, 10:31

Re: String Things - Stand-alone string manipulation function

28 May 2014, 11:28

Verdlin wrote:Thanks, Joe. It's actually slightly different than that.

Code: [Select all] [Download] (Script.ahk)GeSHi © Codebox Plus

{
Msgbox % st_Concat("|", 1, 2, 3, 4,5 ,6)
return
}

st_Concat(delim, as*)
{
for k, v in as
s .= v . delim
return s
}



using those braces for the auto-execute section is unnecessary

User avatar
AfterLemon
Posts: 83
Joined: 30 Sep 2013, 14:27
Location: Arizona, USA

Re: String Things - Stand-alone string manipulation function

28 May 2014, 11:47

Verdlin wrote:I would find a st_Concat(delim, s*...) function quite useful.


I'm not sure that's more than a few characters you might be saving. Obviously it could be done, but it's not even something that's easier done in a function than just with a single command.

Data:="a,b,c,d,e,f,g,h",Data:=ST_Concat("|",Data*)
vs
Data:="a,b,c,d,e,f,g,h"
StringReplace,Data,Data,`,,|,1
HOME: Windows 7 x64 SP1 Ultimate | AMD FX 8350 8-Core @ 4.00GHZ | 16GB Ram
WORK: Windows 7 x64 SP1 Home Premium | AMD Athlon II X4 640 @ 3.00GHz | 8GB Ram
MOBILE: Samsung Galaxy Note 3 | 2012 Asus Nexus 7 | Zune 80Gb

Return to “Scripts and Functions”

Who is online

Users browsing this forum: Bing [Bot] and 13 guests