This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

[INC] String Stocks


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 07-27-2011 , 20:30   [INC] String Stocks
Reply With Quote #1

String Stocks
Version 0.0.6
by Exolent


Intro:
Ever needed some kind of fancy manipulation for a string that wasn't already available?
With these stocks, you will be able to do almost anything you could want with strings!

Functions:
Code:
is_str_empty(const string[])
is_str_num(const string[])
is_str_alpha(const string[])
is_str_alnum(const string[])
is_str_spaces(const string[])
is_char(c)
is_char_upper(c)
is_char_lower(c)
strrfind(const string[], const sub[], ignorecase = 0, pos = 0)
str_substr(const string[], start, output[], output_len, len = 0)
str_explode(const string[], delimiter, output[][], output_size, output_len)
str_explode_str(const string[], const delimiter[], const output[], output_size, output_len)
str_implode(const input[][], size, delimiter, output[], output_len)
str_implode_str(const input[][], size, const delimiter[], output[], output_len)
str_insert(const string[], const input[], pos, output[], output_len)
str_cat(output[], output_len, ...)
str_parsetok(const text[], token = ' ', trimSpaces = 0, ...)
str_delete(string[], chars, pos)
str_replace(string[], string_len, const what[], const with[], max_replace = 0, ignorecase = 0)
is_str_type(const string[], StrType:flags, const exceptions[] = "")
is_str_float(const string[])
add_commas({Float,_}:value, output[], output_len, bool:is_float = false)
str_addcommas(const string[], output[], output_len)
str_ltrim(string[], const trim[] = " ^n^t^r", ignorecase = 0)
str_rtrim(string[], const trim[] = " ^n^t^r", ignorecase = 0)
str_trim(string[], const trim[] = " ^n^t^r", ignorecase = 0)
str_pad(const string[], pad_size, output[], output_len, const pad_string[] = " ", StrPad:pad_flags = (STRPAD_LEFT | STRPAD_RIGHT))
str_lpad(const string[], pad_size, output[], output_len, const pad_string[] = " ")
str_rpad(const string[], pad_size, output[], output_len, const pad_string[] = " ")
str_repeat(const string[], times, output[], output_len)
str_shuffle(string[])
str_substr_count(const string[], const find[], start = 0, len = 0)
str_ucwords(string[])
str_wordwrap(const string[], output[], output_len, width = 75, const wrapper[] = "^n", bool:cut = false)
str_empty(string[], length = 0)
str_uriencode(const string[], output[], output_len)
str_uridecode(const string[], output[], output_len)
is_str_upper(const string[])
is_str_lower(const string[])
regex_escape(const string[], output[], output_len)
parse_color(const color[], &r = 0, &g = 0, &b = 0)
html_encode(const string[], output[], output_len)
html_decode(const string[], output[], output_len)
Documentation:
See string_stocks.inc.
The forum likes to replace tab characters with 4 spaces, and it just makes it look ugly on here.

Changelog:
Version 0.0.6
- Added html_encode() and html_decode().

Version 0.0.5
- Added parse_color().

Version 0.0.4
- Fixed infinite loop in str_substr_count().

Version 0.0.3
- Several code fixes
- Added str_implode_str() to documentation (it was missing in comments and in post but function existed)
- Added trim[] and ignorecase parameters for str_ltrim() and str_rtrim().
- Added str_trim() function.

Version 0.0.2
- Added is_char(), is_char_upper(), is_char_lower(), str_uriencode(), str_uridecode(), is_str_upper(), is_str_lower(), regex_escape().

Version 0.0.1
- Initial release

Have any problems? Want a new function added?
Speak up! I'll try to help as much as I can and am willing to add new string features as long as they're relevant (meaning I'm not adding a function which copies "hi" into a string).
Attached Files
File Type: inc string_stocks.inc (28.2 KB, 1196 views)
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!

Last edited by Exolent[jNr]; 02-20-2012 at 11:40. Reason: Updated to v0.0.6
Exolent[jNr] is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 18:07.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode