Jump to content
Sign in to follow this  

String UDFs

Recommended Posts


I decided to write a few more (8 more to be exact) UDFs for common string operations. Below is a zip file that contains the main header (StringEx.au3) and an example for every function. The documentation for each function is also located in the main header file.


The functions included are: IndexOf, LastIndexOf, Join, PadLeft, PadRight, ToCharArray, Trim, StringRemove, StartsWith and EndsWith.

Here is an example of removing all vowels from a string.

#include <StringEx.au3>

$sVal = "Hello World! This string will not have any vowels after we call _StringTrim!"
$sVal = _StringTrim($sVal, "aeiou")
MsgBox(0, "", $sVal)

Output: Hll Wrld! Ths strng wll nt hv ny vwls ftr w cll _StrngTrm!

Edited by chris95219

Share this post

Link to post
Share on other sites

Most of those functions are just 1 liners with RegExp... If you're playing with string manipulation, I'd suggest brushing up on that.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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