Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
String function
Message
From
23/02/1998 06:47:39
 
 
To
23/02/1998 05:13:19
General information
Forum:
Visual Basic
Category:
Other
Title:
Miscellaneous
Thread ID:
00080389
Message ID:
00080402
Views:
31
>I want to search a string (say s1) in another string (say s2) and replace the search string (s1_ with another string (r1) .
>
>Is there a function?. I do not know much in VB. So please give the function or, the logic to do the above.
>
>I know VisualFoxpro. The same function is available in VFP as
>------strtran(s1,s2,r1)--------.
>
>What is it's equilant function in Visual Basic.
>Also suggest where can I clarify my doubts in SQL Plus.
>
>
>--Satya


In VB, there's no equivalent to VFP's strtran.

To search for a string in another string, use InStr().
You'll have to get the left portion with Left(), the right portion with Right() and put all 3 strings together: Left() & NewString & Right().

Instead of Left() and Right(), you can use Mid().

More code then VFP. :-(
Guy Barrette, MCSD
============
Blog http://weblogs.asp.net/guybarrette
Microsoft Regional Director, Montreal, Canada www.microsoft.com/rd
MVP, ASP.NET http://mvp.support.microsoft.com/
President, Montreal Visual Studio User Group www.guvsm.net
INETA Regional Rep for Quebec www.ineta.org
UniversalThread Magazine Columnist (.NET Books Review Column) www.utmag.com
Tech Chair French Track, DevTeach 2004 & 2005 www.devteach.com
Business Architect, Microsoft Team - Nurun Inc www.nurun.com
XBox Live Gamer Tag: Slomo QC CA
Previous
Reply
Map
View

Click here to load this message in the networking platform