當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。