The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 786 - File: showthread.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/showthread.php 786 errorHandler->error






Post Reply 
 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
STRREPLACE
Author Message
Crusader
Master
**

Posts: 254
Likes Given: 7
Likes Received: 19 in 12 posts
Joined: Apr 2012
Reputation: 6

Erehwon New Hera

Post: #1
STRREPLACE
oh no another one!
yes, that's mine. takes into account commas too....but ofc might be improved, feel free to post improvements below =)

Code:
[FUNCTION STRREPLACE]
// OldWord, NewWord, String
LOCAL.OLDWORD=<ARGV[0]>
LOCAL.NEWORD=<ARGV[1]>
LOCAL.EATFIRST=<STREAT <ARGS>>
LOCAL.STRCLEAN=<STREAT <LOCAL.EATFIRST>>
LOCAL.DONE=1
WHILE (STRCMPI(<LOCAL.STRCLEAN>,0)!=0)
    LOCAL.COMADD=
    LOCAL.COMACHECK=<EVAL STRLEN(<LOCAL.STRCLEAN>)>
    LOCAL.START=<STRARG <LOCAL.STRCLEAN>>
    LOCAL.STOP=<STREAT <LOCAL.STRCLEAN>>
    LOCAL.COMACHECK2=<EVAL STRLEN(<LOCAL.START>) + STRLEN(<LOCAL.STOP>)>
        IF (STRCMP(<LOCAL.START>,<LOCAL.OLDWORD>))==0
            LOCAL.START =<LOCAL.NEWORD>
        ENDIF
        IF (STRCMPI(<LOCAL.STOP>,0)==0)
            LOCAL.STRCLEAN=
        ELSE
            LOCAL.STRCLEAN=<LOCAL.STOP>
        ENDIF
        IF <DLOCAL.COMACHECK> > <EVAL <LOCAL.COMACHECK2>+1>
            LOCAL.COMADD=1
        ENDIF
        IF (<DLOCAL.DONE> == 1)
            IF <DLOCAL.COMADD>==1
                LOCAL.DONE ="<LOCAL.START>,"
            ELSE
                LOCAL.DONE ="<LOCAL.START>"
            ENDIF
        ELSE
            IF <DLOCAL.COMADD>==1
                LOCAL.DONE .= " <LOCAL.START>,"
            ELSE
                LOCAL.DONE .= " <LOCAL.START>"
            ENDIF
        ENDIF
ENDWHILE
RETURN <LOCAL.DONE>


edit oh right, commas, thx mordy.
(This post was last modified: 09-05-2014 07:49 AM by Crusader.)
09-04-2014 06:07 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 2 users Like Crusader's post
Post Reply 


Messages In This Thread
STRREPLACE - Crusader - 09-04-2014 06:07 PM
RE: STRREPLACE - Mordaunt - 09-05-2014, 04:28 AM
RE: STRREPLACE - Extreme - 09-05-2014, 06:08 AM
RE: STRREPLACE - Extreme - 09-05-2014, 12:11 PM
RE: STRREPLACE - Extreme - 09-06-2014, 05:35 AM
RE: STRREPLACE - kn4tseb - 09-06-2014, 05:47 AM
RE: STRREPLACE - XuN - 09-06-2014, 11:05 PM
RE: STRREPLACE - kn4tseb - 09-07-2014, 03:03 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)