Format:
Recent snippets matching tags of string
CREATE PROC SearchAllTables ( @SearchStr nvarchar(100) ) AS BEGIN CREATE TABLE #Results (ColumnName nvarchar(370), ColumnValue nvarchar(3630)) SET NOCOUNT ON
31 Views
no comments
/// <summary> /// Creates a Connection string from Conf.xml /// </summary> /// <param name="isEntityConnection"> /// The is Entity Connection. /// </param> /// <param name="serverName"> /// The server Name. /// </param> /// <param name="databaseName">
48 Views
no comments
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib>
60 Views
no comments
// create date time 2008-03-09 16:05:07.123 DateTime dt = new DateTime(2008, 3, 9, 16, 5, 7, 123); String.Format("{0:y yy yyy yyyy}", dt); // "8 08 008 2008" year String.Format("{0:M MM MMM MMMM}", dt); // "3 03 Mar March" month String.Format("{0:d dd ddd dddd}", dt); // "9 09 Sun Sunday" day String.Format("{0:h hh H HH}", dt); // "4 04 16 16" hour 12/24 String.Format("{0:m mm}", dt); // "5 05" minute String.Format("{0:s ss}", dt); // "7 07" second String.Format("{0:f ff fff ffff}", dt); // "1 12 123 1230" sec.fraction
69 Views
no comments
// Just two decimal places String.Format("{0:0.00}", 123.4567); // "123.46" String.Format("{0:0.00}", 123.4); // "123.40" String.Format("{0:0.00}", 123.0); // "123.00" // Max. two decimal places String.Format("{0:0.##}", 123.4567); // "123.46" String.Format("{0:0.##}", 123.4); // "123.4" String.Format("{0:0.##}", 123.0); // "123"
71 Views
no comments
[Mixin("String.prototype")] public static class StringExtensions { public static bool StartsWith(string value) { return ((string)Script.Literal("this")).IndexOf(value) == 0; } }
300 Views
1 comments
/// <summary> /// Encrypts the conn string. /// </summary> /// <remarks></remarks> public void EncryptConnString() { Configuration config = WebConfigurationManager.OpenWebConfiguration(Request.ApplicationPath); ConfigurationSection section = config.GetSection("connectionStrings"); if (!section.SectionInformation.IsProtected)
183 Views
no comments
var
list: TStringList;
begin
list := TStringList;
try
list.Add( 'Testando' );
ListBox1.Items.Assign( list );
finally
list.free;
end;
204 Views
no comments
/// <summary> /// Extracts a string from between a pair of delimiters. Only the first /// instance is found. /// </summary> /// <param name="source">Input String to work on</param> /// <param name="StartDelim">Beginning delimiter</param> /// <param name="endDelim">ending delimiter</param> /// <param name="CaseInsensitive">Determines whether the search for delimiters is case sensitive</param> /// <returns>Extracted string or ""</returns> public static string ExtractString(string source, string beginDelim,
298 Views
no comments
To Encrypt, run the following from the Visual Studio command prompt: aspnet_regiis -pe "connectionStrings" -app "/AppName" -prov "RsaProtectedConfigurationProvider" To Decrypt, run the following from the Visual Studio command prompt: aspnet_regiis -pd "connectionStrings" -app "/AppName"
255 Views
no comments
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Web; using System.Collections.Specialized; namespace WebControls { /// <summary>
259 Views
no comments
<Extension()> _ Public Function EqualsAny(ByVal s As String, ByVal items As String, _ Optional ByVal sep As Char = ","c, _ Optional ByVal Comparison As StringComparison = CurrentCultureIgnoreCase) As Boolean Dim itemz As List(Of String) = items.Split(sep).ToList Dim idx = (From x In itemz Where s.Equals(x, Comparison) Select x).ToList EqualsAny = (idx.Count > 0) itemz = Nothing : idx = Nothing End Function
244 Views
no comments
int intValue = 1512; string stringValue = intValue.ToString("#,#", CultureInfo.GetCultureInfo(Thread.CurrentThread.CurrentCulture.Name)); /* Result in US English (en-US) will be 1,512 Result in Swedish (sv-SE) will be 1 512 */
297 Views
no comments
/// <summary> /// Determine if the specified string is blank, where blank is defined /// as null, empty or containing only whitespace characters. /// </summary> /// <param name="value">string to be evaluated</param> /// <returns> /// true if the value is null, empty or contains only /// whitespace characters; otherwise false /// </returns> static bool IsNullOrWhiteSpace(string value)
398 Views
no comments
using System; using System.Text; namespace ConsoleApplication2 { class Program { static void Main(string[] args) { //ავიღოთ რაიმე სტრინგი string s = "me miyvars samyaro imitom rom mze amodis da natels fens yovels"; //გადავიყვანოთ ბაიტების მასივში, რადგან Convert.ToBase64String ბაიტის მასივს იღებს პარამეტრად byte[] strBytes = Encoding.ASCII.GetBytes(s);//თუ გაქვთ უნიკოდური ტექსტი უნდა გამოიყენოთ შესაბამისი კლასი. მაგ Encoding.Unicode
250 Views
no comments
function getQueryStringParams( query ) {
var Params = {};
if ( ! query ) {return Params;}// return empty object
var Pairs = query.split(/[;&]/);
for ( var i = 0; i < Pairs.length; i++ ) {
var KeyVal = Pairs[i].split('=');
if ( ! KeyVal || KeyVal.length != 2 ) {continue;}
var key = unescape( KeyVal[0] );
var val = unescape( KeyVal[1] );
val = val.replace(/\+/g, ' ');
272 Views
no comments
/// <summary> /// Allows setting of a value in a UrlEncoded string. If the key doesn't exist /// a new one is set, if it exists it's replaced with the new value. /// </summary> /// <param name="urlEncoded">A UrlEncoded string of key value pairs</param> /// <param name="key"></param> /// <param name="value"></param> /// <returns></returns> public static string SetUrlEncodedKey(string urlEncoded, string key, string value) {
559 Views
no comments
// 2010-10-12: Code has moved to http://bitbucket.org/jonsagara/extensionmethods/
267 Views
no comments
param ([string] $filename) function splitString([string]$string, [int]$length) { $lines = @(); $stringLength = $string.Length; $position = 0; while ($position -lt $stringLength) {
680 Views
no comments
using System; using System.Configuration; namespace Microsoft.Samples.AspNet.Validators { class UsingRegexStringValidator { static void Main(string[] args) { // Display title.
1578 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
