Convert A String (EG: "x^2") To An Expression ( EG: X^2)?

Apr 20, 2009

I want to convert a string variable into an expression to be evaluate within code. Can this be done?

View 1 Replies


ADVERTISEMENT

Can't Convert Integer To String In Constant Expression

Mar 26, 2010

I'd like to understand why one type can't be converted to another type inside a constant expression.

View 13 Replies

Regular Expression To Find Characters In A String And Convert Them To A Number

Sep 2, 2010

I may have a string for example potato in a vb.net application. I want to find all the occurrences of o and convert them to 0, so the desired out is: p0tat0.I know it can be done by the provided string operations but I need a regular expression in my scenario.

View 1 Replies

C# - Solve This Error "Cannot Convert Lambda Expression To Type 'string' Because It Is Not A Delegate Type"

Jun 12, 2010

. I get this error: "Cannot convert lambda expression to type 'string' because it is not a delegate type" - keyword select become underlined in blue

[Code]...

Above code should displays drop list of employees first name and last name in a combo box

View 2 Replies

Converting Arithmetic Expression With Operators In A String To An Operable Arithmetic Expression

Feb 5, 2010

I must convert string data from a CNC that is arithmetic expression to a number that I can use in a VB application that I wrote. The following is what I get out of the cnc. [18722*65536+19377]/67108864. I need to evaluate this expression in my VB ap. The format of the string is not always the same as what I have illustrated.

View 2 Replies

Convert VB6 Expression Into .Net?

Nov 29, 2011

The code you posted while similar to VB6 has method and syntax that is very similar to Crystal Reports Scripting Language

[Code]...

View 1 Replies

.net - Convert C# Lambda Expression To VB?

Mar 23, 2012

In looking at Fuzzy Date Time Picker Control in C# .NET? Piotr Czaapla's answer to that question is exactly what I need. unfortunately, I'm a VB.NET guy and I'm not that familiar with lambda expresions, so my attempts to convert the code have resulted in hours of misplaced parenthesis and banging my head with a brick.

Any chance some bi-lingual wizard could convert the C# code to VB.net for me?

[Code]...

View 3 Replies

Convert C# Lambda += Expression To VB?

Feb 15, 2011

How should the following C# code be converted to VB.Net? I have tried several code converters and none produce correct results.

[code]...

View 4 Replies

Convert Linq.expression From C# To VB?

Mar 30, 2010

[QueryInterceptor("Somethings")]
public Expression<Func<Something, bool>> OnSomethings()
{
// Code here
}

I had a view guesses, looked on msdn, but there are no examples matching the way that that is used.

View 1 Replies

Convert LINQ Query Expression From C# To VB?

Mar 10, 2009

I have the following C# LINQ query expression:

[code]...

how to convert this to VB.NET?

View 1 Replies

Get A Regular Expression That Can Validate That A String Is An Alphanumeric Comma Delimited String?

Jun 23, 2011

I need a regular expression that can validate that a string is an alphanumeric comma delimited string.

Examples:

123, 4A67, GGG, 767 would be valid.
12333, 78787&*, GH778 would be invalid
fghkjhfdg8797< would be invalid

This is what I have so far, but isn't quite right: ^(?=.*[a-zA-Z0-9][,]).*$

View 3 Replies

C# - Convert This Anonymous Method / Lambda Expression Across?

Feb 23, 2010

How would you convert this to VB (using .NET 4.0 / VS2010) ?

bw.DoWork += (o, args) =>
{
Code Here
};

I thought maybe like this:

AddHandler bw.DoWork,
Function(o, args)[code]....

But it says Function does not return a value on all code paths.

View 6 Replies

Convert Lambda Expression In OrderBy Predicate From C#

Apr 24, 2012

I've got the following to sort entities by their job position. The desired order ist defined in another array. In C# this code works:[code]However I will have to convert this to VB.net. I read the equivalent would be something like the following:[code]This does not compile, gives me "Expression expected" right after the Function(x). What am I doing wrong?

View 1 Replies

Regex - Regular Expression To Convert Ul To Textformat And Back, With A Different Attribute Value For First Tag ?

Apr 1, 2010

This is a related to a previous question I have asked here, see the link below for a brief description as to why I am trying to do this.Regular expression from font to span (size and colour) and back (VB.NET).Basically I need a regex replace function (or if this can be done in pure VB then that's fine) to convert all ul tags in a string to textindent tags, with a different attribute value for the first textindent tag.For example:

<ul>
<li>This is some text</li>
<li>This is some more text</li>[code].....

Basically I want the first ul tag to have no indenting, but all nested ul tags to have an indent of 20.

View 2 Replies

Use A String As An Expression?

May 29, 2012

how can I use a string ( string = "my.resources.imagename" ) as an expression? like this:

dim imageString as string = "my.resources." + name 'name will be declared and is the name of the person of who the picture in the resources is picturebox1.image = (expression from string here)

is this possible? if yes, how then? I searched all over the internet but I couldn't find it

View 6 Replies

Evaluating A String Expression?

Feb 17, 2010

Does anybody know of a call in vb.net that will evaluate a string expression. For example, how would one evaluate the expression "(1+2)*(3+4)"?I've looked all over and it seems that people are writing their own parsers. There has to be a better way. After all these years, VB.Net must have something that will take an expression and evaluate it.

Dim strMyExpression as string = "(1+2)*(3+4)"
msgbox( VBEvaluate(strMyExpression))

and the result would be 35.Also, when will microsoft start to use google as the search engine for these forums? Bing really sucks. Searching for "Evaluating a string expression in VB.net" gives the most bizarre links.

View 7 Replies

Parsing A Expression String?

Jun 28, 2010

im doing a simple calculatro and was happy with the way i done things .. a ew member variables and a properties:

Private MVAR_Number1 As Decimal
Private MVAR_Number2 As Decimal
Private MVAR_Operator As Char[code].....

he want to add this:

Dim Operators() As Char = ("+", "-", "*", "/")
Dim OpPos as Decimal
OpPos = Expr.IndexOfAny(Operators)[code].....

Just drives me mad how complex this is all getting for something so simple, fell like giving it all up .

View 6 Replies

C# - Finding A String Expression In An Sentence?

Mar 17, 2011

I have like a three word expression: "Shut The Door" and I want to find it in a sentence. Since They are kind of separated by space?

View 6 Replies

Evaluating A String Expression At Runtime?

Aug 27, 2009

I have a application that allows the user to enter a series of nested filtering commands. E.g "Name starts with x or ((Description contains y or Property1 is On) and Property2 > 100)"

I can preprocess this and distill it down to a string in the form of an expression of True and False's ie, To "True or ((False or True) and False)" Is there a simple way to have this final expression evaluated without having to write a complex evaluator myself?

I have seen a method of evaluating this by compiling a dummy function at runtime but as I need to process this against possibly thousands of records that solution is too slow.

BTW These are not all fields in a database so I cannot use Queries or SQL etc.

View 2 Replies

Evaluating Mathematical Expression In A String?

Jul 7, 2011

Is there a method that allows me to evaluate a mathematical expression in a string? Example (Not actual Code):

Input = "2+2"
Output = SomeMethod(Input)
Output = 4

Update: Nevermind, I found a way around it by using DataTable.Compute.

View 1 Replies

Regular Expression - Match A String

Jul 2, 2009

I want to match a string for example "yes" but where it is not in brackets so that the following would be matched: yes (bla yes bla) bla yes

View 7 Replies

Regular Expression : Match A String That Contains A,B,C,D,E And F?

Jul 2, 2009

I want a regular expression for the following issue:I want to match a string that contains A,B,C,D,E and F. string length should be 0 to 6. and not character should be repeat in the string.Example: ABCDEF, ACDEFB, EFBCDA, etc. but not ABBCDES/W Engineer

View 3 Replies

String Expression Containing Substring To Replace?

Sep 13, 2011

from the Help in VS 2008: Replace: Returns a string in which a specified substring has been replaced with another substring a specified number of times.

Expression
Required. String expression containing substring to replace.
Find
Required. Substring being searched for.
Replacement
Required. Replacement substring.
Start

Optional. Position within Expression where substring search is to begin. If omitted, 1 is assumed.Count Optional. Number of substring substitutions to perform. If omitted, the default value is 1, which means "make all possible substitutions."

Compare Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. See Settings for values.

[Code]...

View 14 Replies

Test If An Expression Contains A Part Of A String?

Feb 27, 2009

In a Select Case statement is there a way to test if an expression contains a part of a string? Something like this:

Select Case myString
Case "*abc*" 'any string that contains "abc" falls here
Case "*def*" 'etc
End Select

View 2 Replies

Regular Expression That Checks Input String

Oct 26, 2009

I understand the concept of regular expressions but I am looking for a regular expression string that checks the input string for the following criteria only...
1.) Upper and lower case letters
2.) The space character
3.) Apostrophe
4.) Comma
5.) Period
6.) Hyphen

View 9 Replies

Regular Expression To Return A String In Between Two Brackets

Mar 19, 2009

Ok - this may seem like a strange request ... but basically I need a regular expression to return a string in between two brackets as described below... String:

[Code]....

View 1 Replies

Use A Regular Expression To Find A Certain String Within A Textbox?

Jul 29, 2009

I am trying to use a regular expression to find a certain string within a textbox.

Is it possible to include the equals sign (=) within the regex so it looks for this? When i type the equals sign within the regex it doesn't fnid it any more.

Works when searching this string - "and JobID 816138</Detail>":

[Code]....

View 3 Replies

Building Regex (regular Expression) - Get Data Out Of String?

May 21, 2009

ok, For the moment I have a string() where each element is in the structure of

[Code]...

View 2 Replies

Evaluate Mathematical Expression From User Input String?

May 19, 2010

I am making a simple calculator that will evaluate functions I have a entry box and the user types in simple equations i.e. 1+4*3/5=? how would i make this evaluate the string?

View 7 Replies

Make A Regular Expression To Find A Substring Within A String?

Nov 20, 2009

How do I make a regular expression to find a substring within a string that looks like: |sdrt446-7fdfs23| ? The number of characters and types change. So I need whatever in within the | |.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved