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


ADVERTISEMENT

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

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

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

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 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

Match Whole Words With Regular Expression For Any Kind Of String?

Jan 4, 2012

I want to match whole words for any kinds of strings, my

Text: to happening behitond .to.the to curtains of this .<NET> open <NET> sou<NET>rce project.<NET>

now i have tried this to find "<NET>" (without quotes) the whole word with[code]...

View 3 Replies

Converting Precompiled VisualBasicValue<TResult> Expression Into Its String Equivalent?

Jun 23, 2011

We all know that this method will convert an expression text (string) to precompiled VisualBasicValue. Refer to this documentation for more details

VisualBasicDesignerHelper.CreatePrecompiledVisualBasicValue

View 2 Replies

Regular Expression Needed To Replace Return Character With Another String?

Jan 21, 2010

I'm trying to replace all the carriage return characters in a string obtained from a multi line text box in a Windows Form with the string ", <BR>" so that when I use the string in some HTML it displays correctly.

Function Blah(ByVal strInput As String) As String
Dim rexCR As Object
rexCR = CreateObject("VBScript.RegExp")

[code]....

View 3 Replies

Regular Expression Replaces Special Chars With Numbers Instead Of String?

Jun 30, 2010

I'm using the following to strip special characters out of a URL:

Dim urlReg As New Regex("[^dw ]")
inurl = urlReg.Replace(inurl, "")

[code]......

View 2 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

Can A LINQ Or A LAMBDA Expression Be Used To Count The 1's In A Binary String Or Char Array

Sep 15, 2010

Can a LINQ or a LAMBDA expression be used to count the 1's in a binary string ?For example, if I convert a number to its BINARY using.>>

Dim binaryString As String = Convert.ToString( numberVariable, 2 )

1) Without using a loop such as a FOR NEXT loop, can I count the number of 1's in the STRING using LINQ or a LAMBDA expression?

2) Can I get the indexes of where the 1's are at in a collection such as a LIST using LINQ or a LAMBDA expression?I know the syntax of some LINQ expressions, however, I don't know which method may be suitable.

View 2 Replies

DB/Reporting :: Writing Colon - Syntax Error In String In Query Expression

Oct 12, 2008

Here is a code to insert data to DBaccess from textbox. When I write a colon(') in the textbox to add to DB it caused error and show me this Message "Syntax error in string in query expression '''')'

Code:
Dim conn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" _
& "Data Source =" & Application.StartupPath & "Store.mdb ")
Dim cmd As New OleDbCommand
cmd.Connection = conn
'Add text to DB
[Code] .....

View 8 Replies

Regex - Regular Expression Needed To Replace Return Character With Another String?

Jul 20, 2009

I'm trying to replace all the carriage return characters in a string obtained from a multi line text box in a Windows Form with the string ", <BR>" so that when I use the string in some HTML it displays correctly.

Function Blah(ByVal strInput As String) As String
Dim rexCR As Object
rexCR = CreateObject("VBScript.RegExp")

[code]....

View 5 Replies

Regular Expression To Match Alphabetic String And Require At Least One Uppercase And One Lowercase

Jul 20, 2009

I am trying to write a regular expression string match in vb.net. The condition that I am trying to implement is that the string should contain only alphabets and must contain atleast one letter of both lower and upper case. i.e AAA-fail, aaa-fail, aAaA-pass.

The regular expression that I have come up with is ^(([a-z]+[A-Z]+)+|([A-Z]+[a-z]+)+)$

View 3 Replies

Regex - Regular Expression To Extract Numbers From Long String Containing Lots Of Punctuation?

Aug 27, 2009

I am trying to separate numbers from a string which includes %,/,etc for eg (%2459348?:, or :2434545/%). How can I separate it, in VB.net

View 4 Replies

VS 2008 CodeDom - Create A Procedure Which Will Evaluate A String Expression As If It Were A Line Of Code

Oct 12, 2009

I am trying to create a procedure which will evaluate a string expression as if it were a line of code...Kind of like what a graphing calculator does when you enter a formula. Does anyone have any experience with this in VB? I have an example of C++ code which uses CodeDom, but I am a bit rusty with my C++!

View 4 Replies







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