banner_ad

vb.net

This query is : Resolved 

Avatar

Querist : Anonymous

Profile Image
Querist : Anonymous (Querist)
21 December 2010 use of string in vb.net?

22 December 2010 Be specific. What do you want to know regarding string??

Avatar

Querist : Anonymous

Profile Image
Querist : Anonymous (Querist)
22 December 2010 sir, please tell me what is sring in vb.net and when it is use??

03 August 2025 ### ✅ What is a **String** in VB.NET?

In **VB.NET**, a `String` is a **data type** used to store **textual data**, such as words, sentences, or any sequence of characters (letters, numbers, symbols, etc.).

---

### 🔤 Example of a String:

```vb.net
Dim message As String = "Hello, World!"
```

Here, `message` is a variable of type `String` that holds the text `"Hello, World!"`.

---

### 🛠️ Common Uses of Strings:

1. **Storing user input**

```vb.net
Dim name As String = Console.ReadLine()
```

2. **Combining (concatenating) strings**

```vb.net
Dim firstName As String = "John"
Dim lastName As String = "Doe"
Dim fullName As String = firstName & " " & lastName
```

3. **Checking length of a string**

```vb.net
Dim length As Integer = fullName.Length
```

4. **Substring operations**

```vb.net
Dim part As String = fullName.Substring(0, 4) ' Gets "John"
```

5. **Replacing text**

```vb.net
Dim newName As String = fullName.Replace("Doe", "Smith")
```

6. **Comparing strings**

```vb.net
If name = "Admin" Then
Console.WriteLine("Access Granted")
End If
```

---

### 💡 Notes:

* `String` is a **reference type** in .NET.
* It is **immutable**, meaning once created, its value cannot be changed directly (modifications return a new string).

---

Let me know if you want examples using string functions like `Split()`, `ToUpper()`, `Trim()`, etc.


You need to be the querist or approved CAclub expert to take part in this query .
Click here to login now


CCI Pro

Similar Resolved Queries


loading


Unanswered Queries



CCI Pro
Meet our CAclubindia PRO Members

Follow us
add to google news



Answer Query



Company
16 May 2026
Account & Audit Asst

RAHUL KHANDEBHARAD & ASSOCIATES

Nashik

B.Com

View Details
Company
07 May 2026
CA Assistant

amit desai and co

Mumbai

CA Final

View Details
Company
09 May 2026
Audit Manager

Kanna and Associates

Coimbatore

CA Inter

View Details
Company
26 May 2026
CA / MBA (Finance) / CMA / M.Com (Finance)

Sri Aurobindo Gnostic Centre of Education

New Delhi

CA

View Details
Company
11 May 2026
Post office

Post office

Anakapalle

Others

View Details
Company
18 May 2026
MIS Executive

Primarc Pecan Retail Limited

Mumbai

B.Com

View Details
Company
08 May 2026
CHARTERED ACCOUNTANT

SHAH LADHA AND ASSOCIATE

Ahmedabad

CA

View Details
Company
11 May 2026
CA Dropout

Patron Accounting LLP

Pune

CA Inter

View Details