| Author: :) Bob (: 03 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
Hai
Using the ascii code.... u can find the string is start with alphabet "A" or using string.indexOf("A"). this will return the position of the character
|
| Author: greeny_1984 03 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
hi,
check this example
function checkA() { var obj=document.getelementbyid('<%=txtbox1.ClientID%>').value; if(obj.charAt(0)!='A' ) { alert('Invalid'); return false; } return True; }
Regards, Greeny_1984
Rate this Response[Excellent/Good/Poor] FRESHERS check this link Need help from me join here
|
| Author: Anil Kumar Pandey 03 Nov 2009 | Member Level: Diamond | Rating:  Points: 2 |
hi, try like this
string str = "Anil"; int a = str.IndexOf("A"); if(a==1) { //first char is A }
Thanks & Regards Anil Kumar Pandey
|
| Author: rajanigrandhi 03 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
function CheckIt() { var element = "ARajani"; var subSection = element.substring(1,0); var answer = false;
if(subSection == “A” ) answer = true;
if(subSection == “A” ) answer = true;
alert(answer);
}
|
| Author: lakshya 05 Nov 2009 | Member Level: Gold | Rating:  Points: 2 |
use indexOf('a')
Happy dotneting Spread Smiles :-) Visit Lakshya
|