[Include] [INC] strlib v1.3 - Simple string modification (Update: 21/10/09)
#21

Quote:
Originally Posted by /^We(stie|z+[e|a
r)$/ ]
Updated! woo!
Good, waited for this.
Reply
#22

Now this is insane. I was about to write a string handling library myself, but got stuck on the explode part.

Seif directed me here so thanks A LOT! Both Seif and Westie :]
Reply
#23

nice,Good job!

i will check it later..
Reply
#24

Awesome include, nice work Westie
Reply
#25

How does explode work? I want to delete something at the end of a string for example I want to delete the = symbol out of this sentence: pie=

but how would I do this?
Reply
#26

Westie, I love you.
Reply
#27

i have problem with explode(); can you help me pls? :P
i have that code:
Код:
new dane[256];
dane = "text|nextext";
new showdane[256];
explode(showdane, dane, "|"); //this is line where is error
and i got this error:

Код:
C:\Users\mario713\Desktop\samp03asvr_R4_win32\gamemodes\truckrp.pwn(292) : error 048: array dimensions do not match
Reply
#28

Sorry if this sounds rude, but I made this a while ago and it works like the PHP substr_count() function:

pawn Код:
stock substr_count( substring[], string[] )
{
    new tmpcount;
  for( new i = 0; i < strlen( string ); i++)
  {
        if( strfind( string[ i ], substring, true ) )
        {
          tmpcount++;
        }
  }
  return tmpcount;
}
Reply
#29

Quote:
Originally Posted by mario713
i have problem with explode(); can you help me pls? :P
i have that code:
Код:
new dane[256];
dane = "text|nextext";
new showdane[256];
explode(showdane, dane, "|"); //this is line where is error
and i got this error:

Код:
C:\Users\mario713\Desktop\samp03asvr_R4_win32\gamemodes\truckrp.pwn(292) : error 048: array dimensions do not match
You need multidimentional arrays for showdane.

Код:
new dane[256];
dane = "text|nextext";
new showdane[10][256];
explode(showdane, dane, "|");
That's just an example. Next time, please read the docs.
Reply
#30

reupload?
Reply
#31

From Westie's signature:
Quote:

What's that? You can't download my files? Well, my server had a heart attack and lost its entire hard drive contents. Well done server. Stop asking for downloads, I'll put them up whenever.

Reply
#32

Really useful, thanks.
Reply
#33

hey. i have a problem.. erm

with str_replace - why does it not convert more than 2 words in a string?

Example, i put "Hello Moto Moto" and put "World" as the replacing string.. so like it returned "Hello World Moto"

maybe its because of
pawn Код:
iItterations = (iLengthSource - iLengthTarget)
?
Edit: yep it was that, i put it to
pawn Код:
iItterations = (iLengthSource/* - iLengthTarget*/)
and it works fine, thanks for your functions Westie!
Reply
#34

very nice and useful include ;p Maybe I use it
Reply
#35

http://files.typefish.co.uk/sa-mp/strlib.inc
is not working?
Reply
#36

Quote:
Originally Posted by Donya
Посмотреть сообщение
...
I thought I had fixed that? Oh well...

Brownie points to whomever posts the link and asks whether the server is down.
Reply
#37

reupload!
Reply
#38

Reupload for who needs it:
http://pastebin.com/GTaVZqfT

(Sorry if you call this bumping...)
Reply
#39

Nice job Westie ^^
Really useful for /announce
Reply
#40

This include is really awesome! That really made my day.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)