Click here to Skip to main content
15,887,240 members
Home / Discussions / C#
   

C#

 
GeneralRe: What do *you* use Rx for? Pin
SledgeHammer0120-Mar-15 5:15
SledgeHammer0120-Mar-15 5:15 
GeneralRe: What do *you* use Rx for? Pin
Pete O'Hanlon20-Mar-15 5:38
mvePete O'Hanlon20-Mar-15 5:38 
QuestionAPLICATION Pin
Member 1153708318-Mar-15 15:57
Member 1153708318-Mar-15 15:57 
AnswerRe: APLICATION Pin
Dave Kreskowiak18-Mar-15 16:18
mveDave Kreskowiak18-Mar-15 16:18 
GeneralRe: APLICATION Pin
Pete O'Hanlon18-Mar-15 21:43
mvePete O'Hanlon18-Mar-15 21:43 
GeneralRe: APLICATION Pin
Dave Kreskowiak19-Mar-15 2:12
mveDave Kreskowiak19-Mar-15 2:12 
AnswerRe: APLICATION Pin
PIEBALDconsult18-Mar-15 17:13
mvePIEBALDconsult18-Mar-15 17:13 
Questionnew to c# - confused about substrings (Solved) Pin
Member 1153707618-Mar-15 15:51
Member 1153707618-Mar-15 15:51 
Hello,
I'm new to c# but I have lots of programing experience, mostly with Delphi, and C.

so what I am trying to do is simple
take this string "1/32" ..

look for the "/" .. everything before that is the numerator, everything after is the denominator..

so I can't seem to get this simple code to work! What on earth am I doing wrong? Any help understand what is causing the out of bounds exception for the denominator would be most appreciated.
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ScaleCalc.scaletoolsutility
{
    class testScaleCalcUtils1
    {
        static void Main()
        {
            string stw;
            string st1 = "1/32";
          // this also causes exception 
  
          stw = st1.Substring(1,st1.length -1);
  
         // this causes an exception
           stw = st1.Substring(2, 3);

            Console.WriteLine(stw);


        }
    }
}


modified 18-Mar-15 23:04pm.

AnswerRe: new to c# - confused about substrings Pin
phil.o18-Mar-15 16:03
professionalphil.o18-Mar-15 16:03 
GeneralRe: new to c# - confused about substrings Pin
Member 1153707618-Mar-15 16:42
Member 1153707618-Mar-15 16:42 
GeneralRe: new to c# - confused about substrings Pin
phil.o18-Mar-15 17:06
professionalphil.o18-Mar-15 17:06 
QuestionDetect the last device connected to a serial port Pin
Member 1085025318-Mar-15 14:11
Member 1085025318-Mar-15 14:11 
AnswerRe: Detect the last device connected to a serial port Pin
Richard Andrew x6418-Mar-15 14:46
professionalRichard Andrew x6418-Mar-15 14:46 
QuestionMessage Removed Pin
18-Mar-15 9:04
professionalN_tro_P18-Mar-15 9:04 
AnswerRe: Geo location Pin
Richard Deeming18-Mar-15 10:13
mveRichard Deeming18-Mar-15 10:13 
QuestionLearning C# course Pin
Aindriu Mac Giolla Eoin18-Mar-15 8:23
Aindriu Mac Giolla Eoin18-Mar-15 8:23 
AnswerRe: Learning C# course Pin
Afzaal Ahmad Zeeshan18-Mar-15 11:06
professionalAfzaal Ahmad Zeeshan18-Mar-15 11:06 
GeneralRe: Learning C# course Pin
Aindriu Mac Giolla Eoin18-Mar-15 11:40
Aindriu Mac Giolla Eoin18-Mar-15 11:40 
GeneralRe: Learning C# course Pin
Afzaal Ahmad Zeeshan18-Mar-15 11:42
professionalAfzaal Ahmad Zeeshan18-Mar-15 11:42 
GeneralRe: Learning C# course Pin
Aindriu Mac Giolla Eoin18-Mar-15 12:02
Aindriu Mac Giolla Eoin18-Mar-15 12:02 
GeneralRe: Learning C# course Pin
Richard Givis24-Mar-15 10:48
Richard Givis24-Mar-15 10:48 
GeneralRe: Learning C# course Pin
Aindriu Mac Giolla Eoin24-Mar-15 11:55
Aindriu Mac Giolla Eoin24-Mar-15 11:55 
GeneralRe: Learning C# course Pin
Richard Givis24-Mar-15 11:58
Richard Givis24-Mar-15 11:58 
GeneralRe: Learning C# course Pin
Aindriu Mac Giolla Eoin19-Apr-15 8:26
Aindriu Mac Giolla Eoin19-Apr-15 8:26 
QuestionRe: Learning C# course Pin
Richard Givis20-Apr-15 3:44
Richard Givis20-Apr-15 3:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.