惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
U
Unit 42
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
P
Proofpoint News Feed
F
Full Disclosure
月光博客
月光博客
Engineering at Meta
Engineering at Meta
博客园_首页
The Register - Security
The Register - Security
G
Google Developers Blog
The Cloudflare Blog
博客园 - Franky
K
Kaspersky official blog
A
Arctic Wolf
Scott Helme
Scott Helme
C
Cisco Blogs
Hugging Face - Blog
Hugging Face - Blog
C
Check Point Blog
NISL@THU
NISL@THU
AI
AI
D
DataBreaches.Net
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Stack Overflow Blog
Stack Overflow Blog
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
量子位
Vercel News
Vercel News
T
Tor Project blog
P
Privacy International News Feed
D
Docker
I
Intezer
L
LangChain Blog
P
Proofpoint News Feed
Security Latest
Security Latest
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
博客园 - 聂微东
AWS News Blog
AWS News Blog
Martin Fowler
Martin Fowler
P
Privacy & Cybersecurity Law Blog
V
V2EX
Last Week in AI
Last Week in AI
C
Cybersecurity and Infrastructure Security Agency CISA
The Hacker News
The Hacker News
T
Tenable Blog
Blog — PlanetScale
Blog — PlanetScale
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog

博客园 - huadust

msdn 网络编程 委托用法 注册表操作 DateTime各种用法 [转]将dll汇入exe 用DataTable构建树 Lock Review Class Review DataTable opertion Drag DataGridView Data To TreeView 2009_01_15_星期三 2009_01_02_星期五 2008_12_31_星期三 2008_12_24_星期三 2008_12_20_星期六 2008_12_17_星期三 2008_12_06_星期六 2008_12_04_星期四
String Review
huadust · 2009-07-23 · via 博客园 - huadust

class Program
{
    
static void Main()
    {
        
string input1 = "123456";
        GetStr1(input1);
        Console.WriteLine(input1);
string input2 = "123456";
        GetStr2(
ref input2);
        Console.WriteLine(input2);
string input3 = "123456";
        GetStr3(
out input3);
        Console.WriteLine(input3);

        Console.ReadLine();
    }

static string GetStr1(string input)
    {
        input 
= "Hello";
        
return input;
    }
static string GetStr2(ref string input)
    {
        input 
= "Hello";
        
return input;
    }
static string GetStr3(out string input)
    {
        input 
= "Hello";
        
return input;
    }
}

Result is:
123456
Hello
Hello

Actual:

string input2 = null;
string input3 = null;

Result is the same.