Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Team,

for example : '9869472979','9932145698'
In first mobile number, index 0 and 1 have value 9 and 8
In Second Mobile Number, index 0 and 1 have value 9 and 9
So If index o and 1 have value 9 and 8 then show otherwise don't show that number .

I have the Code as follow:
C#
var obj = ['9869472979', '9930229947', '022-22556212'];
            $.each(obj, function (i, val) {
                if (val.indexOf(47) > 0)
                    alert(' Mobile Number is ' + val + );
            });



Thanks in advance
Harshal
Posted
Updated 31-Jul-14 1:22am
v3
Comments
R Harshal 31-Jul-14 5:56am    
Hi Peter and CHill60.
Please guide me in this situation.

Thanks in Advance
Harshal

1 solution

Is this question to Peter and Chill60 only ? :). If not i am giving the example code like the following.

C#
var obj = ['123456798','123567890'];
            $.each(obj, function (i, val) {
                if(val.indexOf(4)< 0)
                    alert(val);
            });

Output of this script will be, it skips the phonenumbers that are containing 4 as per your query.
 
Share this answer
 
Comments
R Harshal 31-Jul-14 6:25am    
Most of my query get solved from Peter and Chill60 thats why i wrote their name ..
Secondily ,its work for me .
I want to know were i am wrong
I have array as follows :
var mobileArray =
[{
num1: 9869472979
},
{
num1: 9930216658
},
{
num1: 6598364266
}];
Is it something wrong in my array ??
let me know.
Thank you Sir ..
R Harshal 31-Jul-14 7:03am    
Hi Kumarbs,

Please guide Me for the updated Question.

Thanks in Advance
Harshal
Kumarbs 31-Jul-14 7:09am    
I am not understanding the question, can you improve it?
R Harshal 31-Jul-14 7:20am    
for example : '9869472979','9932145698'
In first mobile number, index 0 and 1 have value 9 and 8
In Second Mobile Number, index 0 and 1 have value 9 and 9
So If index o and 1 have value 9 and 8 then show otherwise don't show that number .

Thanks in Advance
Harshal
R Harshal 31-Jul-14 7:27am    
Please team help me ..

Thanks in Advance
harshal

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900