473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

leftmost letter extract in vb.net

121 100+
hi
how to get the first letter of name for eg n in Nilesh in vb.net
Apr 3 '08 #1
2 1489
hi
how to get the first letter of name for eg n in Nilesh in vb.net

You should have a string variable, do simply like below

Dim s As String
s = "test"
s = s.Substring(0, 1)



and you will get the first letter of any string.

if you need in a char, do this
Dim c As Char
c = Convert.ToChar(s)
Apr 3 '08 #2
Plater
7,872 Expert 4TB
You can also treat a string just like char array and address it by index to get a single char.
Expand|Select|Wrap|Line Numbers
  1. Dim s as string
  2. Dim c as char
  3. s="Test"
  4. c=s(0)
  5.  
Apr 3 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Don Crossman | last post by:
Assume a MYSQL table, foo. One column, bar datetime. Two rows: 2004-01-01 08:00:00 2004-02-01 08:00:00 select * from foo where extract(day from bar)=1; 2 rows in set...
12
by: Alan J. Flavell | last post by:
OK, today's email brought a comment from a reader, pointing out something that I'd long since noticed myself but hadn't done anything about it. On my pages, I've got a first-letter style on...
1
by: Patrick | last post by:
I am trying to get "first-letter" to work inline withing an anchor. Actually I have not been able to get it to work within an <a> tag whether inline, linked, or embedded. Using IE6 service pack 1....
3
by: Nathan Sokalski | last post by:
I am using GDI+ to generate buttons in my application. Because I want the left and right edges of the buttons to be a certain number of pixels from the start and end of the text, I need to know (or...
2
by: Mark Hollander | last post by:
Is there a way to remove or hide the leftmost column that displays either the * or right arrow in a datagrid. -------------------------------------------------- Table Heading...
9
by: Ulterior | last post by:
Hi, everyone, I have a simple problem, which bothers me for some while. I will try to explain it - There is some string, whith different letters in it. Is it possible to analyse this string...
4
by: Alexander Vasilevsky | last post by:
How to extract email address from the letter in Outlook Express? http://www.alvas.net - Audio tools for C# and VB.Net developers
13
by: umpsumps | last post by:
Hello, Here is my code for a letter frequency counter. It seems bloated to me and any suggestions of what would be a better way (keep in my mind I'm a beginner) would be greatly appreciated.. ...
3
by: Nen013 | last post by:
So I'm trying to create a function that will extract a word from a string. I'm trying to do this without creating an array. So far I have this: string s = "Hello World"; string t; for (size_t...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.