Ask general questions here.
- Posts: 94
- Joined: Tue Jun 16, 2009 10:27 pm
Is there anyway to ignore the case of a string in a validation statement such as the one below?
Code: Select all
public static void ValidateSiteEnvironment()
Validate.Attribute(repo.FormMain__Site_TN.ListItemSite_Environ_CategoryInfo, "AccessibleValue", Env, Validate.DefaultMessage, false);
In this case the AccessibleValue of 'repo.FormMain__Site_TN.ListItemSite_Environ_CategoryInfo' is something like 'LAND TRACK', but the value of 'Env' is 'Land Track'. I realize I can use ToUpper(); on the variable but this will not always work. The variable is derived on one system, is processed through an inter medium, and displayed on another system. I have no way of know what case the AccessibleValue of the object will be after this process. Thanks
- Posts: 104
- Joined: Mon Sep 13, 2010 9:07 pm
- Location: Toronto, Canada
I think it can be something like that:
if (repo.FormMain__Site_TN.ListItemSite_Environ_CategoryInfo.Text1001.ToString().ToUpper()!="LAND TRACK")
- Posts: 238
- Joined: Mon May 10, 2010 11:04 am
- Location: Dundee, Scotland
You could also use regex in your rxpaths....