string and string[]
hello,
whats the difference here
between string and string[]
thanks
"string" denotes an item of type String
"string[]" denotes an array of type String itemsThanks, EdMicrosoft MVP - ASP/ASP.NET
Gracia mon ami...
Convert from string to integer and vice versa
I’m new to Visual Basic and am developing my first web application with VB. It’s based on at skeleton script from my host provider. It’s a form where users fill in some data, which I validate with the VB script, before the data are sent with an e-mail. I’ve mostly been able to turn the skeleton script into an application which suits my needs, but I’ve run into some problems with code which should be trivial. I need to convert from string to integer and vice versa. I’ve been searching the web, and this forum, for information on how to do this. I’ve found several ways to convert...
String and String[]What will be the advantage of using
myString: String[10]
over
myString: String
Man wrote:
> What will be the advantage of using
> myString: String[10]
> over
> myString: String
"String[10]" is a fixed-length, statically allocated, Ansi-based ShortString.
"String" is a dynamic-length, dynamically allocated, reference counted, Ansi-based
or Unicode-based (depening on Delphi version) Long string.
Unless you absolutely need the static, fixed length nature of ShortString,
such as in records that interact with external systems, you should stay ...
string to string[]
Hi,
I've got this code :
string[] Params;
string SQL = "SELECT * FROM T_MANAGEMENT_PAGES";
SqlCommand myCommand = new SqlCommand(SQL, myConnection);
myConnection.Open();
SqlDataReader myReader = myCommand.ExecuteReader();
try
{
while (myReader.Read())
{
Params_Type = myReader.GetValue(0).ToString();
}
}
catch
{
}
finally
{
}
myReader.Close();
My problem is to obtain Params_Type.
But each time, it says : "impossible to convert '[object]' in 'string[]' &quo...
string() = string()
this code does not work (not instance of object)
Dim Items(), Other() As String
Items = New String() {"A","B","C"}
Other = New String() {}
Other = Items
how can I get all the values ?
angiras
Hi,
If I understand your requirement correctly, this should do it
Dim Items() As String = {"A", "B", "C"}
Dim Other(Items.Length - 1) As String
Items.CopyTo(Other, 0)
To more closely match you code above, but this will be less efficient
Dim Items(), Other() As String
...
Convert String into byte and vice versa
Hi,
I want to know how can i convert byte array into string and then that string again back to the same equivalent byte array.
I tried this:
string str = Convert.ToBase64String(cipherText);
byte[] sampleVar = Encoding.ASCII.GetBytes(str);
But it seems that sampleVar is not equivalent to cipherText which is actually of the type byte[] :(.
Any help...
I am actually using the thing in TDES encryption where i have cipherText stored as string then i load it to string variable and need to convert it nto byte array again .. but it gives bad data. If i dont do the conversion ......
String and string?
Hi guys,
I was wondering the difference between small letter string type and a capital letter String type. Does anyone know about this? Highly appreciate for your answers! Thankz!
The "proper" version is String, as it references the System.String class of the .NET Framework Class Library.
The ability to use string is provided by C#, where it is an alias to String.
Similarly, the "proper" version of an integer is Int32, as it references System.Int32. The ability to use int is provided by C#, and the ability to use Integer is provided by VB.NET, and both int and Integer are aliases...
converting arrayname to string or vice-versaHi,
This one is puzzling me.
I know it's in the faq, to not use variables for variable naming,
but I find it odd that I can't get a "stringified" form of a variable
name, maybe from the symbol table? Or from the B line of modules?
Say I have an array like:
@somename = (1,2,3,4,5);
and I want to write that array to a file, but I
want the file named automatically by just
dropping the @ off of the @somename.
How would you go about doing it? Plus,
I would like to be using strict.
Also the reverse: take a filename like "somename"
and load it to an a...
convert octet string to string
I'm trying to use IDM 3.5.1 provision an AD environmnet with users from
eDir.
We wanna provision as much info as possible, but one attribute gives us
headaches. This is an auxiliary attribute associated with each user in
eDir that has it's syntax set to octet string. Problem is we need to
provision this over to another attribute in AD that uses string as its
syntax.
Is thee a way through XPath or ECMA script to have the value converted
during the provisioning? I've no experience with either XPath or ECMA so
please be detailed in your replies.
Thx
--
jdoeconsu...
Convert string to string array.Hi,
We have a string array argument in datawindow object for 'IN' sql
statement.
Our user enter a string in a single line edit.
How to convert the string to a string array for the argument of
datawindow?
ex. user input : 'A', 'B', 'C'
=> str_arr[]={'A', 'B', 'C'}
dw_1.retrieve(str_arr)
Thanks in advance.
Take a look at the n_cst_string object in the pfc. It has a method called
of_ParseToArray that does exactly what you're looking for. It's a pretty
simple task to 'port' the code ...
Converting a list of string into stringWhen I try the following code in Prism I get the error
"Error 8 (CE15) Type mismatch, cannot assign array of System.String to
System.String "
*****************************************************************
var
mobileNumberList :List<string>
mobNumberArray :string
Begin
mobileNumberList.add('1234567890');
mobNumberArray := mobileNumberList.ToArray();//error here
end;
***************************************************************
What needs to be done to convert an array of strings to a string
Venkatesh
Venkatesh VT a écrit :
> When I...
How to convert a String into a UTF8 String
Hello! I want to convert a normal String into a UTF8 String
for example:myString = BüromyUTF8String = Büros
I dont know how to do this.
In PHP you can do this with myUTF8String = utf8_encode(myString)
Thank you for all hints!
try this
string test ="ÁÉÍÓÚ áéíóú àèìòù äëïöü Ññ €";
byte[] a= System.Text.Encoding.UTF8.GetBytes(test);
string test2= System.Text.Encoding.UTF8.GetString(a);
greetingsBest Regards,Sebastián DopicoBlog Desarrollador
Thank you Sebastián!
If I make it like that - test2 looks the same as test.But I think my problem is solved. (Someone tol...
Concatenate date string & time string & convert to UK DateTime Problem
Hi,
I have a date string (from textbox) & a time string (eg "09:00:00") which i want to concatenate together to form a full date time value which is passed into my sql server table.
However, after i concatenate the strings & use the convert.toDateTime i always get the US date format (which causes problems with my date comparisons). i want it showing the UK date/time format.
I tried inserting the following line in my web.config file on my LOCAL machine but with no luck:<globalization culture="en-GB" uiCulture="en-GB" requestEncoding="...
Convert UPPERCASE string to Upper-Lower Case (ie. THIS IS MY STRING -> This Is My String)
I recently had the need to convert an all capitalized string to upper/lower case, but couldn't find anything to do it in XSLT 1.0. If it helps anyone out, I wrote the following:
Call it using:
<xsl:template match="Ads"> <xsl:call-template name="ToUpperLowerCase"> <xsl:with-param name="inputString" select="YOURSTRINGHERE"/> <xsl:with-param name="index" select="0"/> <xsl:with-param name="loopCount" select="st...