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
12 November 2026
Auditor

Oz Taxation

Vijayawada

Graduate (Any)

View Details
Company
ARTICLESHIP 23 November 2026
Article Trainees - CA Finalist

GOPAL J AGRAWAL & CO.

Noida

CA Inter

View Details
Company
20 November 2026
Senior Accountant

Compass Tex India Pvt Ltd

Coimbatore

CA Inter

View Details
Company
Featured 07 November 2026
Paid Assisstant

DPV & Associates

Chennai

CA Inter

View Details
Company
Featured ARTICLESHIP 18 November 2026
Articles

Saini Pati Shah & Co LLP, Chartered Accountants

Mumbai

CA Foundation

View Details
Company
24 November 2026
Chartered Accountant

WESTCROFT IT SOLUTIONS PVT LTD

Hyderabad

CA

View Details
Company
20 November 2026
Charted Accountant

Cothas Coffee Co.

Bengaluru

CA

View Details
Company
ARTICLESHIP 14 November 2026
Articleship Assistant

B Thejas and Associates

Bengaluru

CA Foundation

View Details