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






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
STRTRIM seems not to be working
Author Message
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #8
RE: STRTRIM seems not to be working
Taken from: http://forum.spherecommunity.net/Thread-Spaces
(12-05-2013 09:06 AM)XuN Wrote:  StrTrim only works for spaces at begin of given string, if you want to remove any spaces from the text they Input use <asciiremove 32,<argtxt[0]>>

Code:
[function asciiremove]
local.ascii=<argv[0]>        //Ascii Dec value of the character we want to remove, for detailed information and IDs look http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
local.text=<streat <args>>    //Text to remove <local.ascii>
local.check=<strpos 0 <dlocal.ascii> <args>>    //We check if we have any specified ascii chr to remove
while <local.check>>0    //If so we begin
    local.len=<eval STRLEN(<local.text>)>    //Length of the text
    local.pos=<strpos 0 <dlocal.ascii> <local.text>>    //Position of current ascii char found
    if (<local.pos>==0)    //If ascii is first char we make aditional IF to remove it
        local.text=<strsub <eval <local.pos>+1> <local.len> <local.text>>    //local.text=Text except first character
    else    //Otherwise we can do whole replacement with one line
        local.text=<strsub 0 <local.pos> <local.text>><strsub <eval <local.pos>+1> <local.len> <local.text>>    //Text until found charText from found char (without spaces nor anything)
    endif
    if (<strpos 0 <dlocal.ascii> <local.text>>==-1)    //We check if we have more ascii chars to remove
        local.check=0    //and we set to 0 if not, to stop while.
    endif    
endwhile
return <local.text>        //Fixed text
08-08-2014 07:09 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
STRTRIM seems not to be working - kn4tseb - 08-08-2014, 03:37 AM
RE: STRTRIM seems not to be working - Skul - 08-08-2014, 03:49 AM
RE: STRTRIM seems not to be working - Skul - 08-08-2014, 05:49 AM
RE: STRTRIM seems not to be working - XuN - 08-08-2014 07:09 AM

Forum Jump:


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