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


C# System.String.Equals方法代码示例

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


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

示例1: readChemSequence

        private IChemSequence readChemSequence(IChemSequence sequence)
        {
            IChemModel chemModel = sequence.Builder.newChemModel();
            ICrystal crystal = null;

            // Get the info line (first token of the first line)
            //UPGRADE_ISSUE: Method 'java.io.BufferedReader.mark' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaioBufferedReadermark_int'"
            //inputBuffer.mark(255);
            //long pos = inputBuffer.BaseStream.Position;
            info = nextVASPToken(false);
            //System.out.println(info);
            //UPGRADE_ISSUE: Method 'java.io.BufferedReader.reset' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaioBufferedReaderreset'"
            //inputBuffer.reset();

            // Get the number of different atom "NCLASS=X"
            //UPGRADE_ISSUE: Method 'java.io.BufferedReader.mark' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaioBufferedReadermark_int'"
            //inputBuffer.mark(255);
            nextVASPTokenFollowing("NCLASS");
            ntype = System.Int32.Parse(fieldVal);
            //System.out.println("NCLASS= " + ntype);
            //UPGRADE_ISSUE: Method 'java.io.BufferedReader.reset' was not converted. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1000_javaioBufferedReaderreset'"
            //inputBuffer.reset();

            // Get the different atom names
            anames = new System.String[ntype];

            nextVASPTokenFollowing("ATOM");
            for (int i = 0; i < ntype; i++)
            {
                anames[i] = fieldVal;
                nextVASPToken(false);
            }

            // Get the number of atom of each type
            int[] natom_type = new int[ntype];
            natom = 0;
            for (int i = 0; i < ntype; i++)
            {
                natom_type[i] = System.Int32.Parse(fieldVal);
                nextVASPToken(false);
                natom = natom + natom_type[i];
            }

            // Get the representation type of the primitive vectors
            // only "Direct" is recognize now.
            representation = fieldVal;
            if (representation.Equals("Direct"))
            {
                //logger.info("Direct representation");
                // DO NOTHING
            }
            else
            {
                throw new CDKException("This VASP file is not supported. Please contact the Jmol developpers");
            }

            while (nextVASPToken(false) != null)
            {

                //logger.debug("New crystal started...");

                crystal = sequence.Builder.newCrystal();
                chemModel = sequence.Builder.newChemModel();

                // Get acell
                for (int i = 0; i < 3; i++)
                {
                    acell[i] = FortranFormat.atof(fieldVal); // all the same FIX?
                }

                // Get primitive vectors
                for (int i = 0; i < 3; i++)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        nextVASPToken(false);
                        rprim[i][j] = FortranFormat.atof(fieldVal);
                    }
                }

                // Get atomic position
                int[] atomType = new int[natom];
                double[][] xred = new double[natom][];
                for (int i2 = 0; i2 < natom; i2++)
                {
                    xred[i2] = new double[3];
                }
                int atomIndex = 0;

                for (int i = 0; i < ntype; i++)
                {
                    for (int j = 0; j < natom_type[i]; j++)
                    {
                        try
                        {
                            atomType[atomIndex] = IsotopeFactory.getInstance(sequence.Builder).getElement(anames[i]).AtomicNumber;
                        }
                        catch (System.Exception exception)
                        {
                            throw new CDKException("Could not determine atomic number!", exception);
//.........这里部分代码省略.........
开发者ID:xuchuansheng,项目名称:GenXSource,代码行数:101,代码来源:VASPReader.cs


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