scripter73
Programmer
Hi,
Does anyone know a way to copy a portion of a string based on a set of positions?
Consider the following string:
theString = "10.11.130.80 - firstname lastname [12/Mar/2001:10:37:53 +0600]"
If I split this string based on spaces, then my array looks like the following:
Array
10.11.130.80
-
firstname
lastname
[12/Mar/2001:10:37:53
+0600]
The problem with this is that I'd to keep the 'firstname' and 'lastname' together, so I can assign
the entire name to a variable. Ideally, I just want everything between the - and [.
I'm able to identify the starting position of 'firstname' and the starting position of the
'['. I'd like to simply read everything between positions A and B. The only problem is that I
can't read this string into any kind of array.
Is there a way to read each individual character into an array? That way I can just reference
the characters I want.
Thanks in advance for the help.
scripter73
Does anyone know a way to copy a portion of a string based on a set of positions?
Consider the following string:
theString = "10.11.130.80 - firstname lastname [12/Mar/2001:10:37:53 +0600]"
If I split this string based on spaces, then my array looks like the following:
Array
10.11.130.80
-
firstname
lastname
[12/Mar/2001:10:37:53
+0600]
The problem with this is that I'd to keep the 'firstname' and 'lastname' together, so I can assign
the entire name to a variable. Ideally, I just want everything between the - and [.
I'm able to identify the starting position of 'firstname' and the starting position of the
'['. I'd like to simply read everything between positions A and B. The only problem is that I
can't read this string into any kind of array.
Is there a way to read each individual character into an array? That way I can just reference
the characters I want.
Thanks in advance for the help.
scripter73