Overclock.net banner

1 - 2 of 2 Posts

·
Registered
Joined
·
1 Posts
Discussion Starter #1


Hello
I'm so sorry to ask
I can't understand the answers

1. Why g is 12?
g = string_pos(a, d);

2. Why r is program?
r = string_copy(d, 1, g-5);

Please explain about string_pos & string_copy
 

·
Registered
Joined
·
3,248 Posts
is this psuedo code for testing or something?

what it looks like to me is

string_pos, used to find the starting point of a string inside of another.
string_pos = string position(string to search for, string to look in)
string_pos(a, d) = position 12 is the position where "is"(a) starts in d

string_copy, used to copy a segment of an existing string
string_copy = string copy(string to look in, starting point, ending point)
string_copy(d, 1, g-5) = program is what is returned when you start at character #1 and move 7 characters into d.
 
1 - 2 of 2 Posts
Top