本文整理汇总了C#中String.ToLower方法的典型用法代码示例。如果您正苦于以下问题:C# String.ToLower方法的具体用法?C# String.ToLower怎么用?C# String.ToLower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类String
的用法示例。
在下文中一共展示了String.ToLower方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SmtpHeader
public SmtpHeader(String n, String v)
{
foreach (String r in _restricted)
{
if (r == n.ToLower()) throw new SmtpException(n + ": restricted header");
}
Name = n;
Value = v;
}
示例2: IsParameterTrue
// Determine if a particular parameter is true.
public bool IsParameterTrue(String paramName)
{
String value = parameters[paramName.ToLower()];
if(value == null)
{
// Special check for "--x" forms of option names.
value = parameters["-" + paramName.ToLower()];
}
if(value == null)
{
return false;
}
else if(String.Compare(value, "true", true) == 0 ||
String.Compare(value, "yes", true) == 0 ||
value == "1" || value == String.Empty)
{
return true;
}
else
{
return false;
}
}
示例3: GetServerTypeForUri
[System.Security.SecurityCritical] // auto-generated
internal Type GetServerTypeForUri(String URI)
{
Contract.Assert(null != URI, "null != URI");
Type serverType = null;
String uriLower = URI.ToLower(CultureInfo.InvariantCulture);
WellKnownServiceTypeEntry entry =
(WellKnownServiceTypeEntry)_wellKnownExportInfo[uriLower];
if(entry != null)
{
serverType = LoadType(entry.TypeName, entry.AssemblyName);
}
return serverType;
}
示例4: RegexBoyerMoore
// Constructs a Boyer-Moore state machine for searching for the string
// pattern. The string must not be zero-length.
internal RegexBoyerMoore(String pattern, bool caseInsensitive, bool rightToLeft, CultureInfo culture) {
Debug.Assert(pattern.Length != 0, "RegexBoyerMoore called with an empty string. This is bad for perf");
int beforefirst;
int last;
int bump;
int examine;
int scan;
int match;
char ch;
if (caseInsensitive)
pattern = pattern.ToLower(culture);
_pattern = pattern;
_rightToLeft = rightToLeft;
_caseInsensitive = caseInsensitive;
_culture = culture;
if (!rightToLeft) {
beforefirst = -1;
last = pattern.Length - 1;
bump = 1;
}
else {
beforefirst = pattern.Length;
last = 0;
bump = -1;
}
// PART I - the good-suffix shift table
//
// compute the positive requirement:
// if char "i" is the first one from the right that doesn't match,
// then we know the matcher can advance by _positive[i].
//
_positive = new int[pattern.Length];
examine = last;
ch = pattern[examine];
_positive[examine] = bump;
examine -= bump;
for (;;) {
// find an internal char (examine) that matches the tail
for (;;) {
if (examine == beforefirst)
goto OuterloopBreak;
if (pattern[examine] == ch)
break;
examine -= bump;
}
match = last;
scan = examine;
// find the length of the match
for (;;) {
if (scan == beforefirst || pattern[match] != pattern[scan]) {
// at the end of the match, note the difference in _positive
// this is not the length of the match, but the distance from the internal match
// to the tail suffix.
if (_positive[match] == 0)
_positive[match] = match - scan;
// System.Diagnostics.Debug.WriteLine("Set positive[" + match + "] to " + (match - scan));
break;
}
scan -= bump;
match -= bump;
}
examine -= bump;
}
OuterloopBreak:
match = last - bump;
// scan for the chars for which there are no shifts that yield a different candidate
/**
*/
while (match != beforefirst) {
if (_positive[match] == 0)
_positive[match] = bump;
match -= bump;
}
//System.Diagnostics.Debug.WriteLine("good suffix shift table:");
//for (int i=0; i<_positive.Length; i++)
// System.Diagnostics.Debug.WriteLine("\t_positive[" + i + "] = " + _positive[i]);
//.........这里部分代码省略.........
示例5: GetPropertyByColumn
/// <summary>
/// 根据column名称,获取获取某个属性的元数据信息(已封装成EntityPropertyInfo)
/// </summary>
/// <param name="columnName"></param>
/// <returns></returns>
public EntityPropertyInfo GetPropertyByColumn( String columnName ) {
return (_propertyHashTable[columnName.ToLower()] as EntityPropertyInfo);
}
示例6: GetProperty
/// <summary>
/// 获取某个属性的元数据信息(已封装成EntityPropertyInfo)
/// </summary>
/// <param name="propertyName"></param>
/// <returns></returns>
public EntityPropertyInfo GetProperty( String propertyName ) {
return (_propertyHashTable[propertyName.ToLower()] as EntityPropertyInfo);
}
示例7: CheckPropertyName
/**
* Using reflection, calls a method on a widget that checks if the name for the property
* that needs to be set is correct.
* @param widgetType The widget type on which we need to do the property validity checking.
* @param propertyName The name of the property that needs to be checked.
* @throws InvalidPropertyNameException This exception is thrown if the set property name is incorrect.
*/
private void CheckPropertyName(Type widgetType, String propertyName)
{
bool propertyExists = false;
// we first check to see if the widgetType has that property implemented
foreach (PropertyInfo pinfo in widgetType.GetProperties())
{
foreach (Attribute attr in pinfo.GetCustomAttributes(false))
{
if (attr.GetType() == typeof(MoSyncWidgetPropertyAttribute))
{
MoSyncWidgetPropertyAttribute e = (MoSyncWidgetPropertyAttribute)attr;
if (e.Name.ToLower().Equals(propertyName.ToLower()))
{
propertyExists = true;
}
}
}
}
// if the property doesn't exist, we throw a InvalidPropertyNameException
if (!propertyExists)
{
throw new InvalidPropertyNameException();
}
}
示例8: IsValidIdentifier
// Determine if "value" is a valid identifier.
protected override bool IsValidIdentifier(String value)
{
if(value == null || value.Length == 0)
{
return false;
}
switch(value[value.Length - 1])
{
case '%': case '&': case '@': case '!':
case '#': case '$':
{
// Strip the type suffix character from the identifier.
value = value.Substring(0, value.Length - 1);
if(value.Length == 0)
{
return false;
}
}
break;
default: break;
}
if(Array.IndexOf(reservedWords, value.ToLower
(CultureInfo.InvariantCulture)) != -1)
{
return false;
}
else
{
return IsValidLanguageIndependentIdentifier(value);
}
}
示例9: Get
/// <devdoc>
/// <para>Allows access to individual items in the collection by name.</para>
/// </devdoc>
public override String Get(String field)
{
if (field == null)
return String.Empty;
field = field.ToLower(CultureInfo.InvariantCulture);
switch (field) {
case "cookie":
return Cookie;
case "flags":
return Flags.ToString("G", CultureInfo.InvariantCulture);
case "keysize":
return KeySize.ToString("G", CultureInfo.InvariantCulture);
case "secretkeysize":
return SecretKeySize.ToString(CultureInfo.InvariantCulture);
case "issuer":
return Issuer;
case "serverissuer":
return ServerIssuer;
case "subject":
return Subject;
case "serversubject":
return ServerSubject;
case "serialnumber":
return SerialNumber;
case "certificate":
return System.Text.Encoding.Default.GetString(Certificate);
case "binaryissuer":
return System.Text.Encoding.Default.GetString(BinaryIssuer);
case "publickey":
return System.Text.Encoding.Default.GetString(PublicKey);
case "encoding":
return CertEncoding.ToString("G", CultureInfo.InvariantCulture);
case "validfrom":
return HttpUtility.FormatHttpDateTime(ValidFrom);
case "validuntil":
return HttpUtility.FormatHttpDateTime(ValidUntil);
}
if (StringUtil.StringStartsWith(field, "issuer"))
return ExtractString(Issuer, field.Substring(6));
if (StringUtil.StringStartsWith(field, "subject")) {
if (field.Equals("subjectemail"))
return ExtractString(Subject, "e");
else
return ExtractString(Subject, field.Substring(7));
}
if (StringUtil.StringStartsWith(field, "serversubject"))
return ExtractString(ServerSubject, field.Substring(13));
if (StringUtil.StringStartsWith(field, "serverissuer"))
return ExtractString(ServerIssuer, field.Substring(12));
return String.Empty;
}
示例10: NameConflicts
/// <devdoc>
/// <para>[To be supplied.]</para>
/// </devdoc>
private bool NameConflicts(String name) {
if (name == null) {
return false;
}
Debug.Assert(_postBackEventTargetVarName.ToLower(CultureInfo.InvariantCulture) == _postBackEventTargetVarName &&
_postBackEventArgumentVarName.ToLower(CultureInfo.InvariantCulture) == _postBackEventArgumentVarName &&
_shortNamePrefix.ToLower(CultureInfo.InvariantCulture) == _shortNamePrefix);
name = name.ToLower(CultureInfo.InvariantCulture);
return name == _postBackEventTargetVarName ||
name == _postBackEventArgumentVarName ||
StringUtil.StringStartsWith(name, _shortNamePrefix);
}
示例11: GetWildcardFilterIndex
// Get the filter index corresponding to a particular wildcard pattern.
// Returns zero if there is no matching filter.
private int GetWildcardFilterIndex(String pattern)
{
// Convert Unix-style wildcards into DOS-style wildcards.
if(pattern == "*")
{
pattern = "*.*";
}
pattern = pattern.ToLower();
// Find the pattern that matches.
int index, posn;
String filter;
for(index = 0; index < filterPatterns.Length; ++index)
{
filter = filterPatterns[index];
posn = filter.IndexOf(pattern);
if(posn != -1)
{
if(posn == 0 || filter[posn - 1] == ';')
{
if((posn + pattern.Length) == filter.Length)
{
return index + 1;
}
else if((posn + pattern.Length) < filter.Length &&
filter[posn + pattern.Length] == ';')
{
return index + 1;
}
}
}
}
return 0;
}
示例12: Push
internal void Push(String tagName)
{
_tagStack.Push(tagName.ToLower(CultureInfo.InvariantCulture));
}
示例13: Note
public Note(string notepad, String title, String Content, DateTime date)
{
this.notepad = notepad.ToLower();
this.title = title.ToLower();
this.content = Content;
this.date = date;
}
示例14: IsReservedWord
// Determine if a string is a reserved word.
private static bool IsReservedWord(String value)
{
if(value != null)
{
value = value.ToLower(CultureInfo.InvariantCulture);
return (Array.IndexOf(reservedWords, value) != -1);
}
else
{
return false;
}
}
示例15: StartupWellKnownObject
[System.Security.SecurityCritical] // auto-generated
internal ServerIdentity StartupWellKnownObject(String URI)
{
Contract.Assert(null != URI, "null != URI");
String uriLower = URI.ToLower(CultureInfo.InvariantCulture);
ServerIdentity ident = null;
WellKnownServiceTypeEntry entry =
(WellKnownServiceTypeEntry)_wellKnownExportInfo[uriLower];
if (entry != null)
{
ident = StartupWellKnownObject(
entry.AssemblyName,
entry.TypeName,
entry.ObjectUri,
entry.Mode);
}
return ident;
}