Quantcast
Channel: Delphi Conversion
Viewing all articles
Browse latest Browse all 6

Delphi Conversion

$
0
0

The String.Substring method can do what you want.
http://msdn.microsoft.com/en-us/library/system.string.substring.aspx

Left n characters of a string is -  S.Substring(0,n)

Right n characters would be - S.Substring(S.Length - n, n)

For searching in a string (to get the n value) see:

IndexOf
http://msdn.microsoft.com/en-us/library/system.string.indexof.aspx

LastIndexOf
http://msdn.microsoft.com/en-us/library/system.string.lastindexof.aspx

The String class has many more methods that enable this sort of manilulation, but you should also look at the stringbuilder class, which is specifically desgined for manipulating strings efficiently
http://msdn.microsoft.com/en-us/library/system.text.stringbuilder.aspx

The System.IO.File class gives you tools for handling files, and System.IO.Directory is for handling folders and their contents.
http://msdn.microsoft.com/en-us/library/system.io.file.aspx
http://msdn.microsoft.com/en-us/library/system.io.directory.aspx

The GetFiles method of the Directory class supports searching for file names on a partial match.
http://msdn.microsoft.com/en-us/library/system.io.directory.getfiles.aspx


Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>