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
Cutting String in the right format
Author Message
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #1
Cutting String in the right format
Hi guys,

yesterday I tried to cut a string via some string function. at the end I got it but it is to large for my mind, I think so.
I used every string function.
Haven´t the script here but the strings are
s_circle_fire_1 or s_circle_fire_2 or ....s_circle_fire_10
I only need the string "circle_fire" at the end and I need it with one function
like f_cut_circle_word s_circle_1
first of all, I cut the s_ down and made a reverse


after that I cut the 1_,2_ .... 10_ down and reversed it back
so the code is very large Smile
Someone knows a lighter version?

Code:
LOCAL.LENGTH = <EVAL STRLEN(<ARGS>)>
LOCAL.NAME=<STRREVERSE <STRSUB 2 <dLOCAL.LENGTH>  <args>>>
LOCAL.LENGTH = <EVAL STRLEN(<LOCAL.NAME>)>
LOCAL.POS = <EVAL <STRPOS 0 _ <LOCAL.NAME>>+1>
LOCAL.NAME = <STRREVERSE <STRSUB <dLOCAL.POS> <dLOCAL.LENGHT> <LOCAL.NAME>>>
(This post was last modified: 10-02-2012 09:21 PM by admin phoenix.)
10-02-2012 05:08 PM
Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Cutting String in the right format
well you can try:

args=s_circle_fire_1, s_circle_fire_2, ....s_circle_fire_10
local.fire=<argv[9]>
10-02-2012 08:38 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #3
RE: Cutting String in the right format
the args include only one string like s_circle_fire_1 or s_circle_fire_2 or s_circle_fire_10
every string has to be cut down in this string "circle_fire"
10-02-2012 09:20 PM
Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #4
RE: Cutting String in the right format
Maybe,
PHP Code:
IF STRMATCH(*CIRCLE_FIRE*,<STRING>)
 
F_CIRCLE_FIRE_BLA
ENDIF 

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
10-03-2012 12:05 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Cutting String in the right format
You can't use strarg or streat to take part of a word, only part of "string" there must be gaps between the words for it to correctly pull the word you want out.
So, either do something like Extreme suggested, or modify your string if possible

[Image: 2nis46r.jpg]
10-09-2012 01:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #6
RE: Cutting String in the right format
do I have using strarg or streat in my function? don´t see it Smile
also extreme didn´t understand me correct. that´s not what I want.
My way works fine but it is a little too much and I wonder if there is a shorter way
10-09-2012 10:13 PM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #7
RE: Cutting String in the right format
Sorry, I misread

[Image: 2nis46r.jpg]
10-10-2012 02:57 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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