Solved

Is there a way to tell if a character in a string is a supset or subset?

Posted on 2013-05-10
4
181 Views
Last Modified: 2013-05-17
Is there a way to tell if a character in a string is a supset or subset?
0
Comment
Question by:NevSoFly
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39157662
Please elaborate.
0
 

Author Comment

by:NevSoFly
ID: 39158203
My apologies I was using the wrong terminology.  I am trying to identify different parts of the expression  2x + 4y2. namely the 4y2 section, where the 2 at the end of the expression is an exponent (superscript).  It is possible that the 2 could also be a subscript in a different expression.

This part of the expression is displayed in a rich textbox and each character in it is assigned to an element in a string array using string.split().   I am attempting to writing a function to identify the different elements in the array (coefficient, variable and operator).  

I have identified everything except for the 2 and do not know how to proceed.

thanks for your time.
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39165479
I think you can check for the previous token and if that is a character (y in this case) then assume it to be exponent.
0
 

Author Comment

by:NevSoFly
ID: 39176585
yes that would work but only if the previous token was a variable.  but this answer is the closest I found.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question