当前位置: 首页>>代码示例>>C#>>正文


C# String.ToUpper方法代码示例

本文整理汇总了C#中System.String.ToUpper方法的典型用法代码示例。如果您正苦于以下问题:C# String.ToUpper方法的具体用法?C# String.ToUpper怎么用?C# String.ToUpper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.String的用法示例。


在下文中一共展示了String.ToUpper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataInfo

		/// <summary> Parses the value string into a recognized type. If
		/// the type specified is not supported, the data will
		/// be held and returned as a string.
		/// *
		/// </summary>
		/// <param name="key">the context key for the data
		/// </param>
		/// <param name="type">the data type
		/// </param>
		/// <param name="value">the data
		///
		/// </param>
		public DataInfo(String key, String type, String value)
		{
			this.key = key;

			if (type.ToUpper().Equals(TYPE_BOOLEAN.ToUpper()))
			{
				data = Boolean.Parse(value);
			}
			else if (type.ToUpper().Equals(TYPE_NUMBER.ToUpper()))
			{
				if (value.IndexOf('.') >= 0)
				{
					//UPGRADE_TODO: Format of parameters of constructor 'java.lang.Double.Double' are different in the equivalent in .NET. 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="jlca1092"'
					data = Double.Parse(value);
				}
				else
				{
					data = Int32.Parse(value);
				}
			}
			else
			{
				data = value;
			}
		}
开发者ID:modulexcite,项目名称:Transformalize,代码行数:37,代码来源:DataInfo.cs

示例2: addEventJump

 public bool addEventJump( String inMemberId, String inEventGroup, String inEventClass, String inAgeDiv, String inTeamCode )
 {
     if ( myTourRow == null ) {
         return false;
     } else {
         if ( ( (byte)myTourRow["JumpRounds"] ) > 0 ) {
             String curAgeDiv = inAgeDiv;
             String curEventGroup = inEventGroup;
             if ( curAgeDiv.ToUpper().Equals( "B1" ) ) {
                 curAgeDiv = "B2";
                 if ( inEventGroup.ToUpper().Equals( "B1" ) ) {
                     curEventGroup = curAgeDiv;
                 }
             } else if ( curAgeDiv.ToUpper().Equals( "G1" ) ) {
                 curAgeDiv = "G2";
                 if ( inEventGroup.ToUpper().Equals( "G1" ) ) {
                     curEventGroup = curAgeDiv;
                 }
             }
             return addEvent( inMemberId, "Jump", curEventGroup, inEventClass, curAgeDiv, inTeamCode );
         } else {
             MessageBox.Show( "Request to add skier to jump event but tournament does not include this event." );
             return false;
         }
     }
 }
开发者ID:WaterskiScoring,项目名称:WaterskiScoringSystem,代码行数:26,代码来源:TourEventReg.cs

示例3: FindFunction

        public override FreeRefFunction FindFunction(String name)
        {
            if (!_functionsByName.ContainsKey(name.ToUpper()))
                return null;

            return _functionsByName[name.ToUpper()];
        }
开发者ID:missxiaohuang,项目名称:Weekly,代码行数:7,代码来源:DefaultUDFFinder.cs

示例4: CheckPrimitivType

 private String CheckPrimitivType(String mehtodName)
 {
     if (mehtodName.ToUpper().Contains("INT")) return typeof(int).ToString();
     if (mehtodName.ToUpper().Contains("STRING")) return typeof(string).ToString();
     if (mehtodName.ToUpper().Contains("FLOAT")) return typeof(float).ToString();
     if (mehtodName.ToUpper().Contains("DOUBLE")) return typeof(double).ToString();
     return mehtodName;
 }
开发者ID:ChristophGr,项目名称:loom-csharp,代码行数:8,代码来源:RemoteType.cs

示例5: getUserID

 public long getUserID(String user_name)
 {
     if (user_name_list.ContainsKey(user_name.ToUpper()))
     {
         return user_name_list[user_name.ToUpper()];
     }
     return -1;
 }
开发者ID:rowan84,项目名称:BibleApp,代码行数:8,代码来源:UserNameManager.cs

示例6: ListFieldData

        public List<string> ListFieldData(String SQLColumn)
        {
            //Create our list that will return our data to SmartSearch. This must be named 'FieldData'.
            List<String> FieldData = new List<String>();

            //Creating SQL related objects
            SqlConnection oConnection = new SqlConnection();
            SqlDataReader oReader = null;
            SqlCommand oCmd = new SqlCommand();

            //Setting our connection string for connection to the database, this will be different depending on your enviroment.
            oConnection.ConnectionString = "Data Source=(local)\\FULL2008;Initial Catalog=GrapeLanes;Integrated Security=SSPI;";

            //Check for valid column name
            if ((SQLColumn.ToUpper() == "VENDNAME") || (SQLColumn.ToUpper() == "CSTCTR"))
            {
                //Setting SQL query to return a list of data
                oCmd.CommandText = "SELECT DISTINCT " + SQLColumn.ToUpper() + " FROM INVDATA";
            }
            else
            {
                //Returns an empty list in case of invalid column
                FieldData.Clear();
                return FieldData;
            }

            try
            {
                //Attempt to open the SQL connection and get the data.
                oConnection.Open();
                oCmd.Connection = oConnection;
                oReader = oCmd.ExecuteReader();

                //Take our SQL return and place it into our return object
                while (oReader.Read())
                {
                    FieldData.Add(oReader.GetString(0));
                }

                //Clean up
                oReader.Close();
                oConnection.Close();
            }
            catch (Exception)
            {
                //Returns an empty list in case of error
                FieldData.Clear();
                return FieldData;
            }

            //Return our list data to SmartSearch if successful
            return FieldData;
        }
开发者ID:Square9Softworks,项目名称:ListBinder,代码行数:53,代码来源:ListUpdate.cs

示例7: GetOID

 public static String GetOID(String name)
 {
     if (name == null)
     {
         return null;
     }
     if (!OIDS.ContainsKey(name.ToUpper()))
     {
         throw new ArgumentException("Se deconoce el algoritmo '" + name + "'");
     }
     return OIDS[name.ToUpper()];
 }
开发者ID:bibou1324,项目名称:clienteafirma,代码行数:12,代码来源:AOAlgorithmID.cs

示例8: Search

        /// <summary>
        /// The search algorithm.
        /// </summary>
        int Search(String text, int index)
        {
            // Get a reference to the diagram.
            Diagram datagram = mainUI.GetDiagramView().Diagram;

            // Check if the index needs to be wrapped around.
            if (index > datagram.Items.Count)
            {
                index = 0;
            }

            // Iterate through all the nodes and check them for the search string.
            for (int i = index; i < datagram.Items.Count; i++)
            {
                // Get a reference to a node.
                DiagramItem item = datagram.Items[i];
                if (item is ShapeNode)
                {
                    ShapeNode note = (ShapeNode)item;
                    // Check if the node contains the search string.
                    if (note.Text.ToUpper().Contains(text.ToUpper()) |
                        (note.Tag != null && note.Tag.ToString().ToUpper().Contains(text.ToUpper())))
                    {
                        mainUI.FocusOn(note);
                        return i;
                    }
                }
            }

            for (int i = 0; i < index; i++)
            {
                // Get a reference to a node.
                DiagramItem item = datagram.Items[i];
                if (item is ShapeNode)
                {
                    ShapeNode note = (ShapeNode)item;
                    // Check if the node contains the search string.
                    if (note.Text.ToUpper().Contains(text.ToUpper()) |
                        (note.Tag != null && note.Tag.ToString().ToUpper().Contains(text.ToUpper())))
                    {
                        mainUI.FocusOn(note);
                        return i;
                    }
                }
            }

            // If nothing is found, return 0.
            return 0;
        }
开发者ID:SergeTruth,项目名称:OxyChart,代码行数:52,代码来源:SearchForm.cs

示例9: Open

        public virtual Boolean Open(String DevicePath)  
        {
            m_Path = DevicePath.ToUpper();
            m_WinUsbHandle = (IntPtr) INVALID_HANDLE_VALUE;

            if (GetDeviceHandle(m_Path))
            {
                if (WinUsb_Initialize(m_FileHandle, ref m_WinUsbHandle))
                {
                    if (InitializeDevice())
                    {
                        m_IsActive = true;
                    }
                    else
                    {
                        WinUsb_Free(m_WinUsbHandle);
                        m_WinUsbHandle = (IntPtr) INVALID_HANDLE_VALUE;
                    }
                }
                else
                {
                    m_FileHandle.Close();
                }
            }

            return m_IsActive;
        }
开发者ID:Conist,项目名称:ds4-tool,代码行数:27,代码来源:ScpDevice.cs

示例10: SequiturComplexity

 public SequiturComplexity(String s)
 {
     S = s;
     chars =  "qwertyuiopåasdfghjklöäzxcvbnm";
     chars += chars.ToUpper();
     chars += "1234567890+-.,<>|;:!?\"()";
 }
开发者ID:kummahiih,项目名称:my-never-ending-projects,代码行数:7,代码来源:SequiturComplexity.cs

示例11: GetRulesForCard

        public static HREngine.Private.HREngineRules GetRulesForCard(String CardID)
        {
            if (!HasRule(CardID))
                return null;

            try
            {
                string strFilePath = String.Format("{0}{1}.xml",
                   HRSettings.Get.CustomRuleFilePath,
                   CardID.ToUpper());

                byte[] buffer = File.ReadAllBytes(strFilePath);
                if (buffer.Length > 0)
                {
                    XmlSerializer serialzer = new XmlSerializer(typeof(HREngine.Private.HREngineRules));
                    object result = serialzer.Deserialize(new MemoryStream(buffer));
                    if (result != null)
                        return (HREngine.Private.HREngineRules)result;
                }
            }
            catch (Exception e)
            {
                HRLog.Write("Exception when deserialize XML Rule.");
                HRLog.Write(e.Message);
            }

            return null;
        }
开发者ID:RyukOP,项目名称:HRCustomClasses,代码行数:28,代码来源:Ruler.cs

示例12: lookupToken

        public int lookupToken(int bas, String key)
        {
            int start = SPECIAL_CASES_INDEXES[bas];
            int end = SPECIAL_CASES_INDEXES[bas + 1] - 1;

            key = key.ToUpper();

            while (start <= end)
            {
                int half = (start + end) / 2;
                int comp = SPECIAL_CASES_KEYS[half].CompareTo(key);

                if (comp == 0)
                {
                    return SPECIAL_CASES_VALUES[half];
                }
                else if (comp < 0)
                {
                    start = half + 1;
                }
                else
                { //(comp > 0)
                    end = half - 1;
                }
            }

            return bas;
        }
开发者ID:carolmkl,项目名称:TrabalhoBD2,代码行数:28,代码来源:Lexico.cs

示例13: GetEffectPoint

 /// <summary>
 /// 效果点数的表达式计算
 /// </summary>
 /// <param name="strEffectPoint"></param>
 /// <returns></returns>
 public static int GetEffectPoint(ActionStatus game, String strEffectPoint)
 {
     int point = 0;
     strEffectPoint = strEffectPoint.ToUpper();
     if (!String.IsNullOrEmpty(strEffectPoint))
     {
         if (strEffectPoint.StartsWith("="))
         {
             switch (strEffectPoint.Substring(1))
             {
                 case "MYWEAPONAP":
                     //本方武器攻击力
                     if (game.AllRole.MyPublicInfo.Hero.Weapon != null) point = game.AllRole.MyPublicInfo.Hero.Weapon.攻击力;
                     break;
                 default:
                     break;
             }
         }
         else
         {
             point = int.Parse(strEffectPoint);
         }
     }
     return point;
 }
开发者ID:JulioCL,项目名称:HearthStone,代码行数:30,代码来源:ExpressHandler.cs

示例14: WordNode

 /// <summary>
 /// Creates a new WordNode.
 /// </summary>
 /// <param name="text">The actual text of the word.</param>
 /// <param name="tag">The part-of-speech of the word.</param>
 /// <param name="confidence">A rating of the confidence of the part-of-speech tagging for this word.</param>
 public WordNode(String text, PartOfSpeechTag tag, double confidence) {
     if(text == null) { throw new ArgumentNullException("text"); }
     this.Text = text;
     this.Tag = tag;
     this.Confidence = confidence;
     if(text == text.ToUpper()) { this.AllCaps = true; }
 }
开发者ID:abb-iss,项目名称:Swum.NET,代码行数:13,代码来源:WordNode.cs

示例15: RegistType

 /// <summary>
 /// 注册资源索引键类型
 /// </summary>
 /// <param name="key">索引键</param>
 /// <param name="type">索引键类型</param>
 /// <returns>是否注册成功</returns>
 public static Boolean RegistType(String key, Type type)
 {
     try
     {
         if (KeyTypeList.ContainsKey(key.ToUpper()))
         {
             throw new Exception("不允许重复注册的KEY");
         }
         KeyTypeList.Add(key.ToUpper(), type);
         return true;
     }
     catch (Exception)
     {
         return false;
     }
 }
开发者ID:caocf,项目名称:workspace-kepler,代码行数:22,代码来源:VerifyManager.cs


注:本文中的System.String.ToUpper方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。