StrFind from pos1 to pos2
#1

strfing(const string[],const sub[],bool:ignorecase=false,pos=0)

Here is defined only starting position, but i need some function with start and end postions, and also i need function to find char at exact position...
Is there any written solution for this?
Reply
#2

strfind only finds a string within another string. I believe you're looking for strmid?
Reply
#3

strfind returns the position where the match is found, so:
pawn Код:
string = "123456789";
new pos = strfind(string, "5", true);
printf("%d", pos);
... would print 4.

So you can simply check if the return value is below your end position.

// Edit: Or maybe you mean what Vince posted. Hopefully either response is useful!
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
strfind only finds a string within another string. I believe you're looking for strmid?
I need to find string1 into another string2 but i want to define start and end postition in strgin2 in which i'm looking for string1. Do you understand me now?
Reply
#5

Oh, ok, I get it. I think the best way to go about it is: store the part of string1 you want to check into the temporary string with strmid. Then use strfind in the temporary string to get what you want.
Reply
#6

I made that minute before your post , but thank you so much however. rep+
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)