agus.supriyanto31
Member
- Joined
- Jun 17, 2014
- Messages
- 7
- Programming Experience
- Beginner
i'm still new about vb.net, and i want to ask a question about read string with substring(fixed length)
and here is the string.
#T|ABudiCityC |ATutiCityCD|BMan |BWoman|
header=#T(length 2)
sub = A,B(length 1)
Name= Budi,Tuti (length 4)
City= cityC ,cityCD (length 6)
gender= man , woman(length 6)
the Header length=2, for A sub is 11, and B sub is 6
and here is the delimiter "|"
so this is the script what i mean(i think, don't know if it right though)
if header.substring(0,2)= "#T" then
if sub.substring(0,1)"A" then
name.substring(1,4)
city.substring(5,7)
else if sub.substring(0,2)="B" then
gender.substring(1,5)
end if
end if
help me please, thanks
and here is the string.
#T|ABudiCityC |ATutiCityCD|BMan |BWoman|
header=#T(length 2)
sub = A,B(length 1)
Name= Budi,Tuti (length 4)
City= cityC ,cityCD (length 6)
gender= man , woman(length 6)
the Header length=2, for A sub is 11, and B sub is 6
and here is the delimiter "|"
so this is the script what i mean(i think, don't know if it right though)
if header.substring(0,2)= "#T" then
if sub.substring(0,1)"A" then
name.substring(1,4)
city.substring(5,7)
else if sub.substring(0,2)="B" then
gender.substring(1,5)
end if
end if
help me please, thanks
![smile.gif](http://www.vbforums.com/images/smilies/smile.gif)