How do you compare two strings with different format strings? For example, in the code below:
str1 = [dataDic1 objectForKey:[finalArray objectAtIndex:indexPath.row]];
str1 contains 124.00,120/70-14,1,759,140/70-14,48.8 x 57.0.
str2 = [dataDic2 objectForKey:[finalArray objectAtIndex:indexPath.row]];
str2 contains 1.00,90/90-6,1,250,90/90-6,45.3 x 87.0.
I want to compare str1
and str2
if ([bike1Str intValue] < [bike2Str intValue]){
NSLog(@"%@", str2);
}
else{
}
For example: if (120/70-14 < 90/90-6)
How do I do this type comparison ?
DataDic1 {
"Displacement_trim" = "124.00 ";
"Dry_Weight" = "<null>";
"Front_Brakes_Size_trim" = "260 ";
"Front_Tire_Size" = "120/70-14";
"Fuel_Capacity_trim" = "13.50 ";
"Overall_Height_trim" = "1,759 ";
"Overall_Length_trim" = "2,230 ";
Power = "";
"Power_Weight_Ratio" = "<null>";
"Rear_Brake_Size_trim" = "240 ";
"Rear_Tire_Size" = "140/70-14";
Stroke = "";
"Torque_trim" = "";
"stroke_trim" = "48.8 x 57.0 ";
}
and finalArray
(
Power_Weight_Ratio,
Rear_Brake_Size_trim,
Dry_Weight,
Torque_trim,
stroke_trim,
Rear_Tire_Size,
Front_Brakes_Size_trim,
Fuel_Capacity_trim,
Overall_Length_trim,
Front_Tire_Size,
Stroke,
Power,
Displacement_trim,
Overall_Height_trim
)
Not only float values i am asking all the all values to compare