变换字符串:“c; b; a; e; d” - > " A; B; C; d; E" ? [英] Transform string : "c;b;a;e;d" -> "a;b;c;d;e" ?
问题描述
谢谢你的帮助!
Indrid
2005年7月11日星期一22:47 :26-0400,Indrid Colt < in **** @ colt.com>
写道:
好吧,您可以使用Split功能创建一个包含5
元素。然后使用任何合适的排序算法对这些项目进行排序。
然后使用Join函数将元素拼接在一起。
-Tom。
谢谢你的帮助!
Indrid
< blockquote> Tom van Stiphout< no ************* @ cox.net>写在
新闻:fk ******************************** @ 4ax.com:
On Mon,2005年7月11日22:47:26 -0400,Indrid Colt
< in **** @ colt.com>写道:
那么,您可以使用Split函数创建一个包含5
元素的数组。然后使用任何合适的排序算法对这些项目进行排序。然后使用Join函数将元素组合在一起
。
对于值都是一个字符的情况,为什么不使用
a ReverseString()函数就像我签名后发布的一样?
-
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
公共函数ReverseString(strInput As String)As String
Dim i As Integer
Dim tmpString As String
Dim tmpOutput As String
tmpString = strInput
对于i = 1到Len(strInput)
tmpOutput = tmpOutput&右(tmpString,1)
tmpString =左(tmpString,Len(tmpString) - 1)
下一个我
ReverseString = tmpOutput
结束功能
David W. Fenton写道:
For如果值都是一个字符的情况,为什么不使用像我的sig之后发布的那样的ReverseString()函数?
嗯?请解释一下你的建议。我可能会打电话给自己
因为没有看到它而变成白痴。无论如何,也许单个字母
代表字符串或数字?
James A. Fortune
>
Thank''s for your help !
Indrid
On Mon, 11 Jul 2005 22:47:26 -0400, "Indrid Colt" <in****@colt.com>
wrote:
Well, you could use the Split function to create an array with 5
elements. Then use any suitable sorting algorithm to sort these items.
Then use the Join function to stitch the elements back together.
-Tom.
Thank''s for your help !
Indrid
Tom van Stiphout <no*************@cox.net> wrote in
news:fk********************************@4ax.com:
On Mon, 11 Jul 2005 22:47:26 -0400, "Indrid Colt"
<in****@colt.com> wrote:
Well, you could use the Split function to create an array with 5
elements. Then use any suitable sorting algorithm to sort these
items. Then use the Join function to stitch the elements back
together.
For a case where the values are all one character, why not just use
a ReverseString() function like the one posted after my sig?
--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Public Function ReverseString(strInput As String) As String
Dim i As Integer
Dim tmpString As String
Dim tmpOutput As String
tmpString = strInput
For i = 1 To Len(strInput)
tmpOutput = tmpOutput & Right(tmpString, 1)
tmpString = Left(tmpString, Len(tmpString) - 1)
Next i
ReverseString = tmpOutput
End Function
David W. Fenton wrote:
For a case where the values are all one character, why not just use
a ReverseString() function like the one posted after my sig?
Huh? Please explain what you''re suggesting. I''ll probably call myself
an idiot for not seeing it. Anyway, perhaps the individual letters
represent strings or numbers?
James A. Fortune
这篇关于变换字符串:“c; b; a; e; d” - > " A; B; C; d; E" ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!