How do I explode/implode a string in asp.net
Posted by webinfiniteMar 2
So you want to separate your string using explode or join your string using implode in vb.net? Explode/implode are functions of the php environment and do not exist in asp.net therefore you must use the split() function to get your results for explode and join() for implode.
Split() Example
mystring = “hello;sir;how are you”;
Result
arrayData(0) would equal “hello”
arrayData(1) would equal “sir”
arrayDate(2) would equal “how are you”
Join() Example
Dim JoinArray(3)
JoinArray(0) = "Welcome"
JoinArray(1) = "to"
JoinArray(2) = "Web Infinite"
Dim strSentence as String
strSentence = join(JoinArray)
Result
strSentence would equal to “Welcome to Web Infinite”
No comments