G Guest May 14, 2005 #1 Hi All, How to convert a one dimensional integer array to a one dimensional array of type string? kd
K Ken Tucker [MVP] May 14, 2005 #2 Hi, You have to manually convert it. Dim arInt(10) As Integer Dim arStr() As String ReDim arStr(arInt.GetUpperBound(0)) For x As Integer = 0 To arInt.GetUpperBound(0) arInt(x) = x Next For y As Integer = 0 To arInt.GetUpperBound(0) arStr(y) = arInt(y).ToString Next Ken --------------- Hi All, How to convert a one dimensional integer array to a one dimensional array of type string? kd
Hi, You have to manually convert it. Dim arInt(10) As Integer Dim arStr() As String ReDim arStr(arInt.GetUpperBound(0)) For x As Integer = 0 To arInt.GetUpperBound(0) arInt(x) = x Next For y As Integer = 0 To arInt.GetUpperBound(0) arStr(y) = arInt(y).ToString Next Ken --------------- Hi All, How to convert a one dimensional integer array to a one dimensional array of type string? kd
H Herfried K. Wagner [MVP] May 14, 2005 #4 Ken Tucker said: Dim arStr() As String ReDim arStr(arInt.GetUpperBound(0)) Click to expand... Why not just 'Dim arStr(arInt.GetUpperBound(0)) As String'?
Ken Tucker said: Dim arStr() As String ReDim arStr(arInt.GetUpperBound(0)) Click to expand... Why not just 'Dim arStr(arInt.GetUpperBound(0)) As String'?
C Cor Ligthert May 14, 2005 #5 Why not just 'Dim arStr(arInt.GetUpperBound(0)) As String'? Click to expand... Why not just dim arStr(arInt.Lenght) as String? After 2 minutes looking at it, I saw that that was the only improvement you did. Cor
Why not just 'Dim arStr(arInt.GetUpperBound(0)) As String'? Click to expand... Why not just dim arStr(arInt.Lenght) as String? After 2 minutes looking at it, I saw that that was the only improvement you did. Cor
H Herfried K. Wagner [MVP] May 14, 2005 #6 Cor Ligthert said: Why not just dim arStr(arInt.Lenght) as String? Click to expand... Because it will create an array that has 'Length' + 1 elements, which is not desired.
Cor Ligthert said: Why not just dim arStr(arInt.Lenght) as String? Click to expand... Because it will create an array that has 'Length' + 1 elements, which is not desired.
C Cor Ligthert May 14, 2005 #7 Herfried, Because it will create an array that has 'Length' + 1 elements, which is not desired. Click to expand... I have a great tip for you. Why not just dim arStr(arInt.Lenght - 1) as String? I forgot that - 1, I would have expected from you that you had seen this, however I like those answers as you give now. Makes me smilling. Cor
Herfried, Because it will create an array that has 'Length' + 1 elements, which is not desired. Click to expand... I have a great tip for you. Why not just dim arStr(arInt.Lenght - 1) as String? I forgot that - 1, I would have expected from you that you had seen this, however I like those answers as you give now. Makes me smilling. Cor