我該如何去查找Elixir中的另一個位串是否存在子位串?爲了測試目的,我需要驗證位串X存在於位串Y中的某處。有沒有簡單的方法來做到這一點與現有的功能? x = "bar"
y = "foo bar baz"
some_substring_function(x, y)
與some_substring_function返回真值。 在此先感謝!
我必須在我的代碼中實現位串(根據某些標準中給出的參數)。 一些標準參數是比特串(具有不同的長度= 3,7,24,1024等)。 我已將他們定義爲:(例:長度3的比特串) #define SIZE 1
struct bt_string
{
/* Array will be min 1 Byte Long,
* this parameter stores the numbe
我在這裏找到了一個很好的資源( Comparing two bitmasks in SQL to see if any of the bits match ),用於在SQL數據庫中執行搜索,在這裏您使用位掩碼存儲具有多個屬性的數據。在這個例子中,所有的數據都是以int形式存儲的,where子句似乎只能用ints。 有沒有簡單的方法來轉換一個非常相似的測試用例來使用完整的位串呢?因此,而不是像一個例
我是新手來正則表達式。 在我的一個作業問題中,我被要求寫下面的正則表達式。 The set of all bit strings (i.e. strings over alphabet {0,1}) that are divisible by 4.
現在,我沒有得到我應該如何開始實現的解決方案。如何找到可以被4整除的位?