I have a SMS counter that count typed character;
I wanna when user type English
char(English chars + sings + numbers) ,counting Variable do ++ to Number: 160
,
But , if in all there r a Persian
char , counting Variable do ++ to Number: 70
what I should to do?
I Fined that this code : var ucs2 = text.search(/[^\x00-\x7D]/)
in php
return What character user ; Persian char or English.
The equivalent code in Java - What is Android؟
private final TextWatcher TextWatcher_Method = new TextWatcher()
{
public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3)
{
cnt2=matn_counter.length();
TextView counter=(TextView)findViewById(R.id.txt_counter);
cnt1=(int) Math.ceil(cnt2/6);
Integer cnt3=(cnt2%6);
counter.setText(Integer.toString(cnt1)+"/"+Integer.toString(cnt3));
}
}