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



Similar Resolved Queries


loading


Unanswered Queries



CCI Pro



Answer Query



Company
16 October 2026
CA article trainee

Zerdi & Co. Chartered Accountants

Pune

CA Inter

View Details
Company
Featured ARTICLESHIP 06 October 2026
Semi Qualified

AJAY SINGH AND CO LLP

Thane

CA Final

View Details
Company
Featured 21 September 2026
Consultant - Reporting

Finrep Advisors LLP

Mumbai

CA

View Details
Company
ARTICLESHIP 30 September 2026
CA Article Assistant

CA Suraj Garg & Associates

New Delhi

CA Final

View Details
Company
26 September 2026
Chartered Accountant

pushpganga ventures

Pune

CA

View Details
Company
10 October 2026
Accounts Associate Level 1

Abic and Mani Chartered Accountants

Kottayam

B.Com

View Details
Company
18 September 2026
Accounts & Finance Specialist

ULTRA CHEMICAL WORKS

Thane

CA Final

View Details
Company
15 October 2026
Senior Accountant

Continental Belting Pvt Ltd

Mumbai

B.Com

View Details