each character in a string
mk76_at_buffalo.edu
Date: 10/29/04
- Next message: Brian Barto: "easy way to add element to array"
- Previous message: Chasecreek Systemhouse: "Re: Get all mail addresses from a domain"
- Next in thread: Ajey Kulkarni: "Re: each character in a string"
- Reply: Ajey Kulkarni: "Re: each character in a string"
- Reply: Gunnar Hjalmarsson: "Re: each character in a string"
- Maybe reply: Bob Showalter: "RE: each character in a string"
- Reply: John W. Krahn: "Re: each character in a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: beginners@perl.org Date: Fri, 29 Oct 2004 14:32:39 -0400
Hi All,
I have to write a code wherein I have to access each character in a
string and compare it with '-'
$_ = $seq1[0];
while(/./g) {
if($1 eq '-') {
$res1[0] .= '-';
}
else {
$res1[0] = "A";
}
}
I have initialised $_ with the string in which I have to search. Now I
know that the while loop will read each and every character in the
string. I just need to get that character read to make the comparison. I
know $1 doesnt work because it is not :) Where is the value returned or
how can I assign a variable the value of the condition in the while loop ?
Thanks,
Manas.
- Next message: Brian Barto: "easy way to add element to array"
- Previous message: Chasecreek Systemhouse: "Re: Get all mail addresses from a domain"
- Next in thread: Ajey Kulkarni: "Re: each character in a string"
- Reply: Ajey Kulkarni: "Re: each character in a string"
- Reply: Gunnar Hjalmarsson: "Re: each character in a string"
- Maybe reply: Bob Showalter: "RE: each character in a string"
- Reply: John W. Krahn: "Re: each character in a string"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|