105 references to string
Aspire.Hosting (1)
Utils\PasswordGenerator.cs (1)
60var result = new string(chars);
Aspire.Playground.Tests (1)
src\Aspire.Hosting\Utils\PasswordGenerator.cs (1)
60var result = new string(chars);
Microsoft.AspNetCore.Components (1)
src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (1)
474outValues.Add(parameterNeedsValue.Name, new string(parameterValueSpan));
Microsoft.AspNetCore.Components.Forms (1)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
112? new(_currentBuffer[_nextEndIndex..])
Microsoft.AspNetCore.Components.Web (1)
src\Components\Shared\src\ExpressionFormatting\ReverseStringBuilder.cs (1)
112? new(_currentBuffer[_nextEndIndex..])
Microsoft.AspNetCore.HttpLogging (1)
BufferingStream.cs (1)
85return new string(bufferWriter.WrittenSpan);
Microsoft.AspNetCore.Routing (1)
Patterns\RoutePatternMatcher.cs (1)
474outValues.Add(parameterNeedsValue.Name, new string(parameterValueSpan));
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
HttpRequestHeadersTests.cs (2)
545headerValueUtf16Latin1CrossOver = new string(headerValue.AsSpan().Slice(0, i + 1)); 606headerValueUtf16Latin1CrossOver = new string(headerValue.AsSpan().Slice(0, i + 1));
Microsoft.AspNetCore.SignalR.StackExchangeRedis (1)
RedisHubLifetimeManager.cs (1)
829return new string(base64[..^2]);
Microsoft.Extensions.Diagnostics.ResourceMonitoring (32)
Linux\LinuxUtilizationParserCgroupV1.cs (14)
114Throw.InvalidOperationException($"Could not get cpu usage from '{_cpuacctUsage}'. Expected positive number, but got '{new string(usage)}'."); 134Throw.InvalidOperationException($"Expected proc/stat to start with '{StartingTokens}' but it was '{new string(bufferWriter.Buffer.WrittenSpan)}'."); 151$"'{_procStat}' should contain whitespace separated values according to POSIX. We've failed trying to get {i}th value. File content: '{new string(stat)}'."); 200Throw.InvalidOperationException($"Could not parse '{_memoryLimitInBytes}' content. Expected to find available memory in bytes but got '{new string(memoryBuffer)}' instead."); 229Throw.InvalidOperationException($"The value of total_inactive_file found in '{_memoryStat}' is not a positive number: '{new string(inactiveMemorySlice)}'."); 243$"We tried to read '{_memoryUsageInBytes}', and we expected to get a positive number but instead it was: '{new string(containerMemoryUsageFile)}'."); 271Throw.InvalidOperationException($"Could not parse '{_memInfo}'. We expected first line of the file to start with '{MemTotal}' but it was '{new string(firstLine)}' instead."); 280Throw.InvalidOperationException($"Could not parse '{_memInfo}'. We expected to get total memory usage on first line but we've got: '{new string(firstLine)}'."); 285Throw.InvalidOperationException($"Could not parse '{_memInfo}'. We expected to get memory usage followed by the unit (kB, MB, GB) but found no unit: '{new string(firstLine)}'."); 298$"We tried to convert total memory usage value from '{_memInfo}' to bytes, but we've got a unit that we don't recognize: '{new string(unit)}'.") 371$"Could not parse '{_cpuSetCpus}'. Expected comma-separated list of integers, with dashes (\"-\") based ranges (\"0\", \"2-6,12\") but got '{new string(content)}'."); 425Throw.InvalidOperationException($"Could not parse '{_cpuCfsQuotaUs}'. Expected an integer but got: '{new string(quotaBuffer)}'."); 443Throw.InvalidOperationException($"Could not parse '{_cpuCfsPeriodUs}'. Expected to get an integer but got: '{new string(periodBuffer)}'."); 473Throw.InvalidOperationException($"Could not parse '{_cpuPodWeight}' content. Expected to find CPU weight but got '{new string(cpuPodWeightBuffer)}' instead.");
Linux\LinuxUtilizationParserCgroupV2.cs (18)
178Throw.InvalidOperationException($"Expected proc/stat to start with '{StartingTokens}' but it was '{new string(bufferWriter.Buffer.WrittenSpan)}'."); 195$"'{_procStat}' should contain whitespace separated values according to POSIX. We've failed trying to get {i}th value. File content: '{new string(stat)}'."); 299Throw.InvalidOperationException($"Could not parse '{_memoryLimitInBytes}' content. Expected to find available memory in bytes but got '{new string(memoryBuffer)}' instead."); 379Throw.InvalidOperationException($"The value of inactive_file found in '{_memoryStat}' is not a positive number: '{new string(inactiveMemorySlice)}'."); 416Throw.InvalidOperationException($"Could not parse '{_memInfo}'. We expected first line of the file to start with '{MemTotal}' but it was '{new string(firstLine)}' instead."); 425Throw.InvalidOperationException($"Could not parse '{_memInfo}'. We expected to get total memory usage on first line but we've got: '{new string(firstLine)}'."); 430Throw.InvalidOperationException($"Could not parse '{_memInfo}'. We expected to get memory usage followed by the unit (kB, MB, GB) but found no unit: '{new string(firstLine)}'."); 443$"We tried to convert total memory usage value from '{_memInfo}' to bytes, but we've got a unit that we don't recognize: '{new string(unit)}'.") 516$"Could not parse '{_cpuSetCpus}'. Expected comma-separated list of integers, with dashes (\"-\") based ranges (\"0\", \"2-6,12\") but got '{new string(content)}'."); 541Throw.InvalidOperationException($"Could not get usage_usec from '{cpuUsageFile}'. Expected positive number, but got '{new string(content.Slice(usageIndex))}'."); 556Throw.InvalidOperationException($"Could not get nr_periods from '{cpuUsageFile}'. Expected positive number, but got '{new string(content.Slice(periodsIndex))}'."); 649Throw.InvalidOperationException($"Could not parse '{cpuLimitsFile}'. Expected an integer but got: '{new string(quotaBuffer)}'."); 659Throw.InvalidOperationException($"Could not parse '{cpuLimitsFile}'. Expected to get an integer but got: '{new string(cpuPeriodSlice)}'."); 688Throw.InvalidOperationException($"Could not parse period value from '{cpuLimitsFile}'. Expected an integer after 'max' but got: '{new string(content)}'."); 703Throw.InvalidOperationException($"Could not parse period value from '{cpuLimitsFile}'. Expected an integer after '-1' but got: '{new string(content)}'."); 715Throw.InvalidOperationException($"Could not parse quota value from '{cpuLimitsFile}'. Expected an integer but got: '{new string(content)}'."); 728Throw.InvalidOperationException($"Could not parse period value from '{cpuLimitsFile}'. Expected an integer after quota but got: '{new string(content)}'."); 769$"Could not parse '{cpuWeightFile}' content. Expected to find CPU weight but got '{new string(cpuPodWeightBuffer)}' instead.");
PresentationCore (3)
MS\Internal\TextFormatting\NumberSubstitution.cs (1)
504digits[i] = new string(twoChars);
System\Windows\Input\TextCompositionManager.cs (1)
414return new string(outputChars.Slice(0, charsWritten));
System\Windows\Media\Imaging\PropVariant.cs (1)
339pszVal = Marshal.StringToCoTaskMemAnsi(new String(stackalloc char[] { (char)value }));
PresentationFramework (2)
MS\Internal\Globalization\BamlResourceContent.cs (1)
100return returnNewInstance ? new string(contentSpan) : null;
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (1)
163return new string(stackalloc char[2] // digit + suffix
System.Data.Odbc (3)
System\Data\Odbc\OdbcHandle.cs (3)
191sqlState = new string(buffer.AsSpan(0, buffer.AsSpan().IndexOf('\0'))); 211sqlState = new string(buffer.AsSpan(0, buffer.AsSpan().IndexOf('\0'))); 217messageBuilder.Append(new string(message.AsSpan(0, message.AsSpan().IndexOf('\0'))));
System.Diagnostics.DiagnosticSource (1)
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (1)
22return new string(result.Slice(0, 1 + charsWritten + s_uniqSuffix.Length));
System.Net.Http (2)
System\Net\Http\Headers\AltSvcHeaderParser.cs (2)
247result = new string(value); 350result = value.Length != 0 ? new string(value) : null;
System.Net.NetworkInformation (1)
System\Net\NetworkInformation\PhysicalAddress.cs (1)
81throw new FormatException(SR.Format(SR.net_bad_mac_address, new string(address)));
System.Net.Primitives (1)
System\Net\IPAddress.cs (1)
465_toString = toString = new string(span.Slice(0, length));
System.Numerics.Tensors (2)
System\Buffers\NIndex.cs (1)
182return new string(span.Slice(0, charsWritten + 1));
System\Buffers\NRange.cs (1)
89return new string(span.Slice(0, pos));
System.Private.CoreLib (37)
src\libraries\Common\src\Interop\Linux\os-release\Interop.OSReleaseFile.cs (2)
45return new string(prettyName); 56return new string(name);
src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (1)
150public override string ToString() => new string(Format(stackalloc char[FormatStringLength]));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs (1)
129decodedFields[i] = BitConverter.IsLittleEndian ? new string(charPayload) : Encoding.Unicode.GetString(MemoryMarshal.Cast<char, byte>(charPayload));
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (1)
776return new string(normalizedName);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (1)
106return changed ? new string(buffer.Slice(0, bufferIndex)) : name;
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (10)
5204return new FormatException(SR.Format(SR.Format_BadDatePattern, new string(result.failureSpanArgument))); 5206return new FormatException(SR.Format(SR.Format_BadDateTime, new string(result.failureSpanArgument))); 5208return new FormatException(SR.Format(SR.Format_BadDateTimeCalendar, new string(result.failureSpanArgument), result.calendar)); 5210return new FormatException(SR.Format(SR.Format_BadDayOfWeek, new string(result.failureSpanArgument))); 5212return new FormatException(SR.Format(SR.Format_BadFormatSpecifier, new string(result.failureSpanArgument))); 5216return new FormatException(SR.Format(SR.Format_DateOutOfRange, new string(result.failureSpanArgument))); 5218return new FormatException(SR.Format(SR.Format_MissingIncompleteDate, new string(result.failureSpanArgument))); 5222return new FormatException(SR.Format(SR.Format_OffsetOutOfRange, new string(result.failureSpanArgument))); 5226return new FormatException(SR.Format(SR.Format_UnknownDateTimeWord, new string(result.failureSpanArgument), result.failureIntArgument)); 5228return new FormatException(SR.Format(SR.Format_UTCOutOfRange, new string(result.failureSpanArgument)));
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (1)
92: new string(result);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (1)
75: new string(result);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (2)
88return new string(destination.Slice(0, charsWritten)); 99return new string(destination.Slice(0, charsWritten));
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (2)
554throw new OverflowException(SR.Format(SR.Overflow_TimeSpanElementTooLarge, new string(_originalTimeSpanString))); 564throw new FormatException(SR.Format(SR.Format_BadTimeSpan, new string(_originalTimeSpanString)));
src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
162return new string(span.Slice(0, charsWritten + 1));
src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (2)
163return FileSystemInfo.Create(fullPath, new string(FileName), _isDirectory, ref _status); 170new string(FullPath);
src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (1)
579throw Interop.GetExceptionForIoErrno(new Interop.ErrorInfo(errno), new string(path));
src\libraries\System.Private.CoreLib\src\System\Range.cs (1)
93return new string(span.Slice(0, pos));
src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (1)
344return new string(new ReadOnlySpan<char>(ref Unsafe.As<T, char>(ref _reference), _length));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (2)
100public override string ToString() => new string(Text); 112string result = new string(Text);
src\libraries\System.Private.CoreLib\src\System\Span.cs (1)
368return new string(new ReadOnlySpan<char>(ref Unsafe.As<T, char>(ref _reference), _length));
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (2)
1709itemFormat = new string(itemFormatSpan); 1748itemFormat ??= new string(itemFormatSpan);
src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (1)
149return new string(new ReadOnlySpan<char>(ref *pDestination, charsWritten)); // this overload of ROS ctor doesn't validate length
src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (2)
204itemFormat = new string(itemFormatSpan); 235itemFormat ??= new string(itemFormatSpan);
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
620throw new FormatException(SR.Format(SR.Format_BadBoolean, new string(value)));
System.Private.Uri (4)
System\IPv4AddressHelper.cs (1)
31return new string(stackSpace.Slice(0, totalChars + charsWritten));
System\IPv6AddressHelper.cs (1)
87return new string(stackSpace.Slice(0, pos));
System\Uri.cs (1)
2522scopeId = scopeIdSpan.IsEmpty ? null : new string(scopeIdSpan);
System\UriHelper.cs (1)
616return backingString ?? new string(strToClean);
System.Private.Xml (5)
System\Xml\BinaryXml\SqlUtils.cs (1)
241return new string(szResult);
System\Xml\BinHexDecoder.cs (1)
121throw new XmlException(SR.Xml_InvalidBinHexValueOddCount, new string(chars));
System\Xml\Serialization\XmlSerializationReader.cs (2)
1006throw new ArgumentException(SR.Format(SR.XmlInvalidArrayLength, new string(lengthStringSpan)), nameof(value)); 1032soapArrayInfo.qname = new string(value.AsSpan(0, pos + 1));
System\Xml\Xsl\Xslt\XsltLoader.cs (1)
998DecimalFormatDecl format = new DecimalFormatDecl(name, infinity, nan, new string(characters));
System.Windows.Forms.Design (1)
System\ComponentModel\Design\ByteViewer.cs (1)
415_edit.Text = new string(text);
System.Windows.Forms.Tests (1)
System\Windows\Forms\RichTextBoxTests.cs (1)
11026return new string(buffer[..length]);